MouseWheel event does not scroll in increments of 120

I connected the MouseWheel event to one of my controls, but found that e.Delta not always a multiple of 120, especially when I scroll through it a lot. I get digits like "131" and "-394".

Why? How can i fix this? This causes problems with my program, where the number (divided by 120) does not correlate with the actual number of marks.

+4
source share
1 answer

Apparently, you can no longer rely on Delta 120. Here is a post about the same release .

And MSDN says :

The delta was set to 120 to allow Microsoft or other manufacturers to create wheels with higher resolution (free-wheeling without notches) to send more messages per revolution, but with a lower value in each message. To use this function, you can either add input delta values ​​until WHEEL_DELTA is reached (so you will get the same answer for delta rotation), or scroll through partial lines in response to more frequent messages. You can also select your scroll detail and accumulate deltas until it is reached.

+5
source

All Articles