Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] ctrl.mouse_buttons_down returns incorrect id(?) #243

Closed
knausj85 opened this issue Feb 14, 2021 · 0 comments
Closed

[Windows] ctrl.mouse_buttons_down returns incorrect id(?) #243

knausj85 opened this issue Feb 14, 2021 · 0 comments

Comments

@knausj85
Copy link

knausj85 commented Feb 14, 2021

  • Windows 10
  • v0.1.4-110

I use the below action to drag & stop dragging via a single voice command. My primary and secondary buttons are NOT switched on Windows.

Despite the call with button=0 below:

ctrl.mouse_click(button=0, up=True)

This function:

ctrl.mouse_buttons_down()

returns a set containing button 1 on windows upon the second drag command

    def mouse_drag():
        """(TEMPORARY) Press and hold/release button 0 depending on state for dragging"""
        button = 0
        if app.platform == "windows":
            button = 1
        print(str(ctrl.mouse_buttons_down()))
        if button not in ctrl.mouse_buttons_down():
            # print("start drag...")
            ctrl.mouse_click(button=0, down=True)
            # app.notify("drag started")
        else:
            # print("end drag...")
            ctrl.mouse_click(button=0, up=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants