-
Notifications
You must be signed in to change notification settings - Fork 780
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
Code cleanup for held mouse buttons #1546
Conversation
|
||
# Start drag | ||
ctrl.mouse_click(button=button, down=True) | ||
|
||
def mouse_drag_end(): | ||
"""Releases any held mouse buttons""" | ||
buttons_held_down = list(ctrl.mouse_buttons_down()) | ||
for button in buttons_held_down: | ||
for button in ctrl.mouse_buttons_down(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctrl.mouse_buttons_down()
returns set[int]
. No need to wrap in a list.
@@ -151,11 +150,7 @@ def mouse_sleep(): | |||
|
|||
show_cursor_helper(True) | |||
stop_scroll() | |||
|
|||
# todo: fixme temporary fix for drag command | |||
button_down = len(list(ctrl.mouse_buttons_down())) > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is basically a recreation of the logic in mouse_drag_end
, but worse.
@@ -132,15 +132,14 @@ def mouse_wake(): | |||
def mouse_drag(button: int): | |||
"""Press and hold/release a specific mouse button for dragging""" | |||
# Clear any existing drags | |||
self.mouse_drag_end() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was surprised this even worked. We should definitely call Talon actions through the action interface.
No description provided.