robot icon indicating copy to clipboard operation
robot copied to clipboard

The horizontal scrolling function 'ScrollH()' does not work as expected on windows

Open vosel opened this issue 8 years ago • 2 comments

There is an issue with the ScrollH() function's behaviour on windows platform. In the documentation to the function, it says that the integer parameter passed to it indicates the amount of the simulated scrollwheel 'notches'. This works fine for the vertical scroll - ScrollV() (the bigger the absolute value of the parameter, the more scroll notches are simulated). But for the horizontal scrolling - ScrollH(), the amount of simulated notches does not depend on the parameter's absolute value. The simulated scrolling always scrolls by one 'notch' (in the direction, which depends on the sign of the parameter's value).

vosel avatar Dec 17 '17 13:12 vosel

The reason of such behaviour is probably caused by the windows handling of the MOUSEEVENTF_HWHEEL events. The winapi's SendInput() function is treating it as a 'wheel tilt' event and assumes that the wheel could be tilted only by one 'notch'. So, it does not use the parameter's absolute value - only it's sign.

See the difference between MOUSEEVENTF_WHEEL and MOUSEEVENTF_HWHEEL in the MSDN documentation page (note the description of the dwData parameter).

vosel avatar Dec 17 '17 13:12 vosel

Thanks, I'll take a look!! Though I tested that feature a lot and never experienced that problem myself.

dkrutsko avatar Dec 18 '17 19:12 dkrutsko