Skip to content

Commit

Permalink
Remove dependency on talon_plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasArvidsson committed Dec 26, 2024
1 parent 45195f4 commit 0fe263b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 40 deletions.
4 changes: 1 addition & 3 deletions plugin/mouse/mouse.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from talon import Context, Module, actions, ctrl, settings, ui
from talon_plugins import eye_zoom_mouse

mod = Module()
ctx = Context()
Expand Down Expand Up @@ -38,8 +37,7 @@
class Actions:
def zoom_close():
"""Closes an in-progress zoom. Talon will move the cursor position but not click."""
if eye_zoom_mouse.zoom_mouse.state == eye_zoom_mouse.STATE_OVERLAY:
actions.tracking.zoom_cancel()
actions.user.deprecate_action("2024-12-26", "user.zoom_close")

def mouse_wake():
"""Enable control mouse, zoom mouse, and disables cursor"""
Expand Down
60 changes: 30 additions & 30 deletions plugin/mouse/mouse.talon
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
control mouse: tracking.control_toggle()
control off: user.mouse_sleep()
zoom mouse: tracking.control_zoom_toggle()
camera overlay: tracking.control_debug_toggle()
run calibration: tracking.calibrate()
control mouse: tracking.control_toggle()
control off: user.mouse_sleep()
zoom mouse: tracking.control_zoom_toggle()
camera overlay: tracking.control_debug_toggle()
run calibration: tracking.calibrate()
touch:
# close zoom if open
user.zoom_close()
tracking.zoom_cancel()
mouse_click(0)
# close the mouse grid if open
user.grid_close()
Expand All @@ -15,14 +15,14 @@ touch:

righty:
# close zoom if open
user.zoom_close()
tracking.zoom_cancel()
mouse_click(1)
# close the mouse grid if open
user.grid_close()

mid click:
# close zoom if open
user.zoom_close()
tracking.zoom_cancel()
mouse_click(2)
# close the mouse grid
user.grid_close()
Expand All @@ -36,101 +36,101 @@ mid click:
#super = windows key
<user.modifiers> touch:
# close zoom if open
user.zoom_close()
tracking.zoom_cancel()
key("{modifiers}:down")
mouse_click(0)
key("{modifiers}:up")
# close the mouse grid
user.grid_close()
<user.modifiers> righty:
# close zoom if open
user.zoom_close()
tracking.zoom_cancel()
key("{modifiers}:down")
mouse_click(1)
key("{modifiers}:up")
# close the mouse grid
user.grid_close()
(dub click | duke):
# close zoom if open
user.zoom_close()
tracking.zoom_cancel()
mouse_click()
mouse_click()
# close the mouse grid
user.grid_close()
(trip click | trip lick):
# close zoom if open
user.zoom_close()
tracking.zoom_cancel()
mouse_click()
mouse_click()
mouse_click()
# close the mouse grid
user.grid_close()
left drag | drag | drag start:
# close zoom if open
user.zoom_close()
tracking.zoom_cancel()
user.mouse_drag(0)
# close the mouse grid
user.grid_close()
right drag | righty drag:
# close zoom if open
user.zoom_close()
tracking.zoom_cancel()
user.mouse_drag(1)
# close the mouse grid
user.grid_close()
end drag | drag end: user.mouse_drag_end()
wheel down: user.mouse_scroll_down()
end drag | drag end: user.mouse_drag_end()
wheel down: user.mouse_scroll_down()
wheel down here:
user.mouse_move_center_active_window()
user.mouse_scroll_down()
wheel tiny [down]: user.mouse_scroll_down(0.2)
wheel tiny [down]: user.mouse_scroll_down(0.2)
wheel tiny [down] here:
user.mouse_move_center_active_window()
user.mouse_scroll_down(0.2)
wheel downer: user.mouse_scroll_down_continuous()
wheel downer: user.mouse_scroll_down_continuous()
wheel downer here:
user.mouse_move_center_active_window()
user.mouse_scroll_down_continuous()
wheel up: user.mouse_scroll_up()
wheel up: user.mouse_scroll_up()
wheel up here:
user.mouse_move_center_active_window()
user.mouse_scroll_up()
wheel tiny up: user.mouse_scroll_up(0.2)
wheel tiny up: user.mouse_scroll_up(0.2)
wheel tiny up here:
user.mouse_move_center_active_window()
user.mouse_scroll_up(0.2)
wheel upper: user.mouse_scroll_up_continuous()
wheel upper: user.mouse_scroll_up_continuous()
wheel upper here:
user.mouse_move_center_active_window()
user.mouse_scroll_up_continuous()
wheel gaze: user.mouse_gaze_scroll()
wheel gaze: user.mouse_gaze_scroll()
wheel gaze here:
user.mouse_move_center_active_window()
user.mouse_gaze_scroll()
wheel stop: user.mouse_scroll_stop()
wheel stop: user.mouse_scroll_stop()
wheel stop here:
user.mouse_move_center_active_window()
user.mouse_scroll_stop()
wheel left: user.mouse_scroll_left()
wheel left: user.mouse_scroll_left()
wheel left here:
user.mouse_move_center_active_window()
user.mouse_scroll_left()
wheel tiny left: user.mouse_scroll_left(0.5)
wheel tiny left: user.mouse_scroll_left(0.5)
wheel tiny left here:
user.mouse_move_center_active_window()
user.mouse_scroll_left(0.5)
wheel right: user.mouse_scroll_right()
wheel right: user.mouse_scroll_right()
wheel right here:
user.mouse_move_center_active_window()
user.mouse_scroll_right()
wheel tiny right: user.mouse_scroll_right(0.5)
wheel tiny right: user.mouse_scroll_right(0.5)
wheel tiny right here:
user.mouse_move_center_active_window()
user.mouse_scroll_right(0.5)
copy mouse position: user.copy_mouse_position()
copy mouse position: user.copy_mouse_position()
curse no:
# Command added 2021-12-13, can remove after 2022-06-01
app.notify("Please activate the user.mouse_cursor_commands_enable tag to enable this command")

# To scroll with a hiss sound, set mouse_enable_hiss_scroll to true in settings.talon
mouse hiss up: user.hiss_scroll_up()
mouse hiss down: user.hiss_scroll_down()
mouse hiss up: user.hiss_scroll_up()
mouse hiss down: user.hiss_scroll_down()
7 changes: 0 additions & 7 deletions plugin/mouse/mouse_scroll.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from typing import Literal

from talon import Context, Module, actions, app, cron, ctrl, imgui, settings, ui
from talon_plugins import eye_zoom_mouse

continuous_scroll_mode = ""
scroll_job = None
Expand Down Expand Up @@ -96,9 +95,6 @@ def mouse_gaze_scroll():
"""Starts gaze scroll"""
global gaze_job, continuous_scroll_mode, control_mouse_forced

if eye_zoom_mouse.zoom_mouse.state != eye_zoom_mouse.STATE_IDLE:
return

continuous_scroll_mode = "gaze scroll"
gaze_job = cron.interval("16ms", scroll_gaze_helper)

Expand Down Expand Up @@ -169,9 +165,6 @@ def noise_trigger_hiss(active: bool):
def mouse_scroll_continuous(new_scroll_dir: Literal[-1, 1]):
global scroll_job, scroll_dir, scroll_start_ts, continuous_scroll_mode

if eye_zoom_mouse.zoom_mouse.state != eye_zoom_mouse.STATE_IDLE:
return

if scroll_job:
# Issuing a scroll in the same direction aborts scrolling
if scroll_dir == new_scroll_dir:
Expand Down

0 comments on commit 0fe263b

Please sign in to comment.