You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Call pywinauto.mouse.scroll(wheel_dist=x) with x a float value
produces
Traceback (most recent call last):
File "pywinauto\mouse.py", line 260, in scroll
_perform_click_input(button='wheel', wheel_dist=wheel_dist, coords=coords)
File "pywinauto\mouse.py", line 177, in _perform_click_input
win32api.mouse_event(
TypeError: 'float' object cannot be interpreted as an integer
This is interesting feature request. I guess it is possible to implement it for high level method .wheel_mouse_input(wheel_dist=0.5) or .click_input() if the scroll bar range is available at the UI element level. More low level function mouse.scroll(wheel_dist=0.5) has no information about any scroll bars, so the ratio 0.5 is undefined at this level.
Thanks for your answer, indeed I was rather thinking about the low level feature. In my use case, there is no scroll bar (I use the scroll event to simulate a swipe up/down in a mobile like app), and a "wheel click" as defined by MS is indeed too coarse to have a fine control on the movement generated by the event. I tested with the low level win32 api and it accepts (and works) with distances which are not multiples of 120 (WHEEL_DELTA).
Expected Behavior
Mouse scroll wheel function should accept float distance values on Windows.
It seems that a simple cast into int on this line https://github.com/pywinauto/pywinauto/blob/bf7f789d01b7c66ccd0c213db0a029da7e588c9e/pywinauto/windows/mouse.py#L321C37-L321C38 would solve the issue. Accepting float values would make sense because the distance is internally multiplied by 120 (one wheel click according to MS). However, I don't know about possible consequences on other systems.
Actual Behavior
Using a float value produces an Exception.
Steps to Reproduce the Problem
produces
Short Example of Code to Demonstrate the Problem
Specifications
The text was updated successfully, but these errors were encountered: