Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: MouseWheel Delta Value  (Read 4669 times)

0 Members and 1 Guest are viewing this topic.

triangle

  • Newbie
  • *
  • Posts: 2
    • View Profile
MouseWheel Delta Value
« on: January 15, 2010, 12:43:30 am »
I have found that the mouse wheel is extremely unresponsive when using the delta provided by WindowImplWin32::ProcessEvent.

Removing the division by 120 in that function solves the problem and gives me smooth scrolling movement.

I am using a Microsoft Wireless Intellimouse Explorer 2.0, which I would presume is quite standard in operation.

There must be a reason for that seemingly arbitary value of 120, maybe a hardware issue?

Is anyone else using mouse wheel events to achieve smooth scrolling?  If so, did you also have to change the delta value?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
MouseWheel Delta Value
« Reply #1 on: January 15, 2010, 08:35:20 am »
The MSDN clearly states that the delta value given by the OS is a multiple of 120, that's why I divide by this value, so that one wheel step == 1 and not 120.

It also says that 120 was chosen to allow vendors to build "finer-resolution wheels (a freely-rotating wheel with no notches)", but 120 is still the base unit, ie. when delta is 120 you scrolled exactly one single step.

I don't think that the Microsoft Wireless Intellimouse Explorer 2.0 has this kind of wheel, does it?
Laurent Gomila - SFML developer

richardwb

  • Newbie
  • *
  • Posts: 3
    • View Profile
MouseWheel Delta Value
« Reply #2 on: January 15, 2010, 10:55:34 am »
That particular mouse does have a smooth scrolling wheel.

If this helps any, I've found that in my own Win32 code (not SFML related) I had to accumulate the delta value (in the high word of wparam) and check if it added up to WHEEL_DELTA or more.

http://msdn.microsoft.com/en-us/library/ms645617%28VS.85%29.aspx

Quote
To use this feature, you can either add the incoming delta values until WHEEL_DELTA is reached (so for a delta-rotation you get the same response), or scroll partial lines in response to the more frequent messages.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
MouseWheel Delta Value
« Reply #3 on: January 15, 2010, 11:03:46 am »
Ah, true. And this reminds me that there is the same problem for Mac OS X users and the Apple mouse.

I'll fix this as soon as I can.

Thanks for your feedback :)
Laurent Gomila - SFML developer

triangle

  • Newbie
  • *
  • Posts: 2
    • View Profile
MouseWheel Delta Value
« Reply #4 on: January 15, 2010, 11:51:59 am »
Quote from: "Laurent"
The MSDN clearly states that the delta value given by the OS is a multiple of 120, that's why I divide by this value, so that one wheel step == 1 and not 120.


It actually says 'The high-order word indicates the distance the wheel is rotated, expressed in multiples or divisions of WHEEL_DELTA, which is 120', so we miss any events that are divisions of 120...