PDA

View Full Version : [SOLVED] How do I find motion of the mouse wheel on SDL?



Fixman
December 28th, 2007, 11:24 PM
I found that there is no event concerning the motion (not pressing) of the mouse wheel. How can this be achieved?

kdub432
December 29th, 2007, 12:01 AM
run

$ xev

and move your mouse wheel in the window and scroll. If nothing shows up, you will probably have to get a custom device driver for your particular mouse. If scrolling wheel produces output, your X server is not mapping your scroll wheel to the scroll command, a much simpler problem

Wybiral
December 29th, 2007, 12:28 AM
The event is processed exactly like SDL handles mouse buttons (the event.type will be SDL_MOUSEBUTTONDOWN and SDL_MOUSEBUTTONUP), the codes (event.button.button) are: SDL_BUTTON_WHEELUP and SDL_BUTTON_WHEELDOWN

Fixman
December 29th, 2007, 01:47 AM
The event is processed exactly like SDL handles mouse buttons (the event.type will be SDL_MOUSEBUTTONDOWN and SDL_MOUSEBUTTONUP), the codes (event.button.button) are: SDL_BUTTON_WHEELUP and SDL_BUTTON_WHEELDOWN

Thanks a lot.