PDA

View Full Version : combining wheel events



mcarter
12th January 2010, 23:47
I have an application that is using the wheelEvent handler to zoom in and out of a data window. If the user scrolls the wheel fairly fast, the function is called multiple times, each with a delta of 120 or -120 (depending on which way the user spins). Is there a way to force these events to be combined so the function receives one large delta? Or is there a way to peek into the event queue to see if there are other wheel events pending?

aamer4yu
13th January 2010, 05:59
You can override the wheelevent and implement your own logic.
What you can do is use a timer. Start the timer when u get a wheel event and the timer is not running.
Stack the events / store delta value for the wheel events that are received while the timer is active, and ignore the event.
Now when the timer gets timed out, emit a signal with the combined delta

Hope you get the idea :)