Clear the click queue before a multi-click

This commit is contained in:
Kovid Goyal 2020-02-25 21:20:41 +05:30
parent 05f289f912
commit 294d01def6
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -74,9 +74,11 @@ def move(x=0, y=0, button=-1, q=None):
self.ae(s, q, '{!r} != {!r} after movement to x={} y={}'.format(s, q, x, y))
def multi_click(x=0, y=0, count=2):
clear_click_queue = True
while count > 0:
count -= 1
ev(GLFW_MOUSE_BUTTON_LEFT, x=x, y=y)
ev(GLFW_MOUSE_BUTTON_LEFT, x=x, y=y, clear_click_queue=clear_click_queue)
clear_click_queue = False
def scroll(x=0, y=0, up=True):
move(x=x, y=y, button=-2 if up else -3)