diff --git a/BREAKING_CHANGES.txt b/BREAKING_CHANGES.txt index 5cd41b12c2..c3968715eb 100644 --- a/BREAKING_CHANGES.txt +++ b/BREAKING_CHANGES.txt @@ -7,6 +7,7 @@ and when the change was applied given the delay between changes being submitted and the time they were reviewed and merged. --- +* 2024-12-26 Deprecated action `user.zoom_close` in favor of `tracking.zoom_cancel`. * 2024-11-24 Deprecated a bunch of symbol commands to insert delimited pairs ("", '', []) in favor of the new `delimiter_pair` Talon list file. * 2024-09-07 Removed `get_list_from_csv` from `user_settings.py`. Please diff --git a/core/deprecations.py b/core/deprecations.py index 00abe45f97..9659a1d361 100644 --- a/core/deprecations.py +++ b/core/deprecations.py @@ -161,18 +161,21 @@ def deprecate_capture(time_deprecated: str, name: str): ) warnings.warn(msg, DeprecationWarning, stacklevel=3) - def deprecate_action(time_deprecated: str, name: str): + def deprecate_action(time_deprecated: str, name: str, replacement: str = ""): """ Notify the user that the given action is deprecated and should - not be used into the future. + not be used into the future; the action `replacement` should be used + instead. """ id = f"action.{name}.{time_deprecated}" deprecate_notify(id, f"The `{name}` action is deprecated. See log for more.") + replacement_msg = f' Instead, use: "{replacement}".' if replacement else "" msg = ( f"The `{name}` action is deprecated since {time_deprecated}." + f"{replacement_msg}" f' See {os.path.join(REPO_DIR, "BREAKING_CHANGES.txt")}' f"{calculate_rule_info()}" ) diff --git a/plugin/mouse/mouse.py b/plugin/mouse/mouse.py index 9e63cdf61c..48211abd04 100644 --- a/plugin/mouse/mouse.py +++ b/plugin/mouse/mouse.py @@ -1,5 +1,4 @@ from talon import Context, Module, actions, ctrl, settings, ui -from talon_plugins import eye_zoom_mouse mod = Module() ctx = Context() @@ -38,8 +37,12 @@ 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", + "tracking.zoom_cancel", + ) + actions.tracking.zoom_cancel() def mouse_wake(): """Enable control mouse, zoom mouse, and disables cursor""" diff --git a/plugin/mouse/mouse.talon b/plugin/mouse/mouse.talon index 10f277439d..974f8025ba 100644 --- a/plugin/mouse/mouse.talon +++ b/plugin/mouse/mouse.talon @@ -5,7 +5,7 @@ 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() @@ -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() @@ -36,7 +36,7 @@ mid click: #super = windows key touch: # close zoom if open - user.zoom_close() + tracking.zoom_cancel() key("{modifiers}:down") mouse_click(0) key("{modifiers}:up") @@ -44,7 +44,7 @@ mid click: user.grid_close() righty: # close zoom if open - user.zoom_close() + tracking.zoom_cancel() key("{modifiers}:down") mouse_click(1) key("{modifiers}:up") @@ -52,14 +52,14 @@ mid click: 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() @@ -67,13 +67,13 @@ mid click: 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() diff --git a/plugin/mouse/mouse_scroll.py b/plugin/mouse/mouse_scroll.py index 6d79bcb0d5..d2bce05818 100644 --- a/plugin/mouse/mouse_scroll.py +++ b/plugin/mouse/mouse_scroll.py @@ -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 @@ -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) @@ -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: