The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Re: Querying mouse wheel movements with SDL?
karx11erx
Guest

Thanks for the info. Problem is that for every wheel movement,
SDL will deliver a button down event, immediately followed by
a button up, which might require some extra code to properly
process mouse wheel actions.
Re: Querying mouse wheel movements with SDL?
David Olofson
Guest

On Wednesday 18 January 2006 12:52, karx11erx wrote:
Quote:
Thanks for the info. Problem is that for every wheel movement,
SDL will deliver a button down event, immediately followed by
a button up, which might require some extra code to properly
process mouse wheel actions.

Well, just ignore the events you don't want. (Unless you're doing
mouse capture, focus handling and stuff like that, you generally do
that anyway.)

One wheel "step" corresponds to one click on a virtual up or down
button. There is no such things as a "down state" of these virtual
up/down buttons, and sending down + up events back to back is as
close as a button oriented API gets to emulating these zero duration
clicks. The only thing wrong with it is that the zero duration isn't
reliably visible through the API.

You'd actually need extra code *without* these "fake" button up
events, because that would make them different from all other button
events.


//David Olofson - Programmer, Composer, Open Source Advocate

.------- http://olofson.net - Games, SDL examples -------.
| http://zeespace.net - 2.5D rendering engine |
| http://audiality.org - Music/audio engine |
| http://eel.olofson.net - Real time scripting |
'-- http://www.reologica.se - Rheology instrumentation --'