Skip to content

Commit

Permalink
maybe fix dragging on OS X, save for Big Sur
Browse files Browse the repository at this point in the history
  • Loading branch information
knausj85 committed Feb 15, 2021
1 parent ecb2178 commit e31ac72
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions code/mouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def mouse_drag():
"""(TEMPORARY) Press and hold/release button 0 depending on state for dragging"""
# todo: fixme temporary fix for drag command
button_down = len(list(ctrl.mouse_buttons_down())) > 0
print(str(ctrl.mouse_buttons_down()))
if not button_down:
# print("start drag...")
ctrl.mouse_click(button=0, down=True)
Expand Down Expand Up @@ -349,3 +350,19 @@ def start_cursor_scrolling():
gaze_job = cron.interval("60ms", gaze_scroll)
# if eye_zoom_mouse.zoom_mouse.enabled and eye_mouse.mouse.attached_tracker is not None:
# eye_zoom_mouse.zoom_mouse.sleep(True)


if app.platform == "mac":
from talon import tap

def on_move(e):
if not config.control_mouse:
buttons = ctrl.mouse_buttons_down()
# print(str(ctrl.mouse_buttons_down()))
if not e.flags & tap.DRAG and buttons:
e.flags |= tap.DRAG
# buttons is a set now
e.button = list(buttons)[0]
e.modify()

tap.register(tap.MMOVE | tap.HOOK, on_move)

0 comments on commit e31ac72

Please sign in to comment.