Page 1 of 1
mouse wheel
Posted: Mon Feb 21, 2011 9:56 pm
by idle
I'm trying to figure out how to get the mouse wheel direction in a windowed screen with opengl subsytem
The SetWindowCallback tip I posted doesn't work once the screen is opened and I don't know if gdk_add_client_message_filter ()
would work either.
window callback
Any ideas?
Re: mouse wheel
Posted: Tue Feb 22, 2011 1:16 pm
by IdeasVacuum
Hello Idle
PB's own ExamineMouse() + MouseWheel() does not work? I have used it with a windowed screen, but not with openGL.
Re: mouse wheel
Posted: Tue Feb 22, 2011 6:56 pm
by idle
No the PB mousewheel doesn't work
Re: mouse wheel
Posted: Wed Feb 23, 2011 6:16 am
by GBeebe
When using OpenGL, I start with SDL to create the window for me:
Code: Select all
Screen = SDL_SetVideoMode_(width, height, depth, #SDL_OPENGL | #SDL_FULLSCREEN)
Then, to get your wheel events:
Code: Select all
While SDL_PollEvent_(@Event.SDL_Event)
Select Event\Type
Case #SDL_MOUSEBUTTONDOWN
If Event\button\button = 4
MouseWheels + 1 ;will add to the scrolling
ElseIf event\button\button = 5
MouseWheels - 1 ;will subtract from the scrolling
EndIf
EndSelect
Wend
Re: mouse wheel
Posted: Fri Feb 25, 2011 9:22 pm
by idle
Thanks for that, I will give it a go.