mouse icon indicating copy to clipboard operation
mouse copied to clipboard

on_button mouse down event

Open sirynka opened this issue 4 years ago • 1 comments

mouse.on_button(btn_press, buttons=[mouse.LEFT], types=[mouse.DOWN]) This event is triggered not every time when the mouse button is pressed. It needs about a second cool down between presses to work properly but mouse.UP event works fine even when i'm jitter clicking.

sirynka avatar May 22 '20 19:05 sirynka

I don't know if you still have this issue, but i found out that it is caused by the way the double-click is handled for windows : if a "down" is close enough to a previous event, it is interpreted as "double", not "down".

if (event.event_type == DOWN) and previous_button_event is not None:
    # https://msdn.microsoft.com/en-us/library/windows/desktop/gg153548%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
    if event.time - previous_button_event.time <= GetDoubleClickTime() / 1000.0:
    event = ButtonEvent(DOUBLE, event.button, event.time)

redhelling21 avatar Sep 10 '23 00:09 redhelling21