From 0f51e3b5b0e3df62a3580e1dbbb86ea9660f62a7 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Fri, 28 Aug 2026 12:30:28 +0200 Subject: [PATCH 01/10] Added mouse_long_click tag --- plugin/mouse/mouse.py | 2 +- plugin/mouse/mouse_long_click.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 plugin/mouse/mouse_long_click.py diff --git a/plugin/mouse/mouse.py b/plugin/mouse/mouse.py index b4c6502f7e..6c9359f406 100644 --- a/plugin/mouse/mouse.py +++ b/plugin/mouse/mouse.py @@ -172,4 +172,4 @@ def noise_trigger_pop(): ) if should_click: - ctrl.mouse_click(button=0, hold=16000) + actions.mouse_click(0) diff --git a/plugin/mouse/mouse_long_click.py b/plugin/mouse/mouse_long_click.py new file mode 100644 index 0000000000..ddeae9d435 --- /dev/null +++ b/plugin/mouse/mouse_long_click.py @@ -0,0 +1,20 @@ +from talon import Context, Module, ctrl + +mod = Module() + +mod.tag( + "mouse_long_click", + desc="Tag for enabling long click behavior", +) + +ctx = Context() +ctx.matches = r""" +tag: user.mouse_long_click +""" + + +@ctx.action_class("main") +class MainActions: + @staticmethod + def mouse_click(button: int = 0): + ctrl.mouse_click(button=button, hold=16000) From 94646368a1c2641e7be8801aa6a803a6783a5dd4 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Fri, 28 Aug 2026 12:36:07 +0200 Subject: [PATCH 02/10] remove mouse click arg --- plugin/mouse/mouse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/mouse/mouse.py b/plugin/mouse/mouse.py index 6c9359f406..2b9ccab902 100644 --- a/plugin/mouse/mouse.py +++ b/plugin/mouse/mouse.py @@ -172,4 +172,4 @@ def noise_trigger_pop(): ) if should_click: - actions.mouse_click(0) + actions.mouse_click() From e4768c6a1b7db95f9216a218849b0802fa218ac1 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Fri, 28 Aug 2026 13:09:04 +0200 Subject: [PATCH 03/10] Renamed to mouse_click_with_hold --- .../mouse/{mouse_long_click.py => mouse_click_with_hold.py} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename plugin/mouse/{mouse_long_click.py => mouse_click_with_hold.py} (66%) diff --git a/plugin/mouse/mouse_long_click.py b/plugin/mouse/mouse_click_with_hold.py similarity index 66% rename from plugin/mouse/mouse_long_click.py rename to plugin/mouse/mouse_click_with_hold.py index ddeae9d435..5fd674a17c 100644 --- a/plugin/mouse/mouse_long_click.py +++ b/plugin/mouse/mouse_click_with_hold.py @@ -3,13 +3,13 @@ mod = Module() mod.tag( - "mouse_long_click", - desc="Tag for enabling long click behavior", + "mouse_click_with_hold", + desc="Hold mouse buttons for 16 ms so clicks register reliably", ) ctx = Context() ctx.matches = r""" -tag: user.mouse_long_click +tag: user.mouse_click_with_hold """ From 3964e41d22f4fc4914f607155a3eb8a106ca95fb Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Fri, 28 Aug 2026 13:12:14 +0200 Subject: [PATCH 04/10] Added settings to setting file --- settings.talon | 3 +++ 1 file changed, 3 insertions(+) diff --git a/settings.talon b/settings.talon index 92011eebab..b77e8f7ff9 100644 --- a/settings.talon +++ b/settings.talon @@ -45,6 +45,9 @@ settings(): # If `true`, use a hissing noise to scroll continuously user.mouse_enable_hiss_scroll = false + # If `true`, hold the mouse buttons down for 16 ms when clicking to increase reliability. + user.mouse_click_with_hold = false + # How much time a hiss must last for to be considered a hiss rather than # part of speech, in ms user.hiss_scroll_debounce_time = 100 From 8842fbbba9f0ba72ab8cfcfb019f457b9f8a2435 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Fri, 28 Aug 2026 13:12:45 +0200 Subject: [PATCH 05/10] Update comment --- settings.talon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.talon b/settings.talon index b77e8f7ff9..083440ede0 100644 --- a/settings.talon +++ b/settings.talon @@ -45,7 +45,7 @@ settings(): # If `true`, use a hissing noise to scroll continuously user.mouse_enable_hiss_scroll = false - # If `true`, hold the mouse buttons down for 16 ms when clicking to increase reliability. + # If `true`, hold mouse buttons for 16 ms so clicks register reliably user.mouse_click_with_hold = false # How much time a hiss must last for to be considered a hiss rather than From 9d638812450d1036c795dbd91b45e1d0d6a5ffbb Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Fri, 28 Aug 2026 13:15:13 +0200 Subject: [PATCH 06/10] Switch setting to tag --- settings.talon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/settings.talon b/settings.talon index 083440ede0..4ed9ca854d 100644 --- a/settings.talon +++ b/settings.talon @@ -45,9 +45,6 @@ settings(): # If `true`, use a hissing noise to scroll continuously user.mouse_enable_hiss_scroll = false - # If `true`, hold mouse buttons for 16 ms so clicks register reliably - user.mouse_click_with_hold = false - # How much time a hiss must last for to be considered a hiss rather than # part of speech, in ms user.hiss_scroll_debounce_time = 100 @@ -139,3 +136,6 @@ settings(): # Uncomment the below to enable the experimental window layout commands # defined in window_layout.talon # tag(): user.experimental_window_layout + +# Uncomment the below to hold mouse buttons for 16 ms so clicks register reliably +# tag(): user.mouse_click_with_hold From 7e90864db144728a08e19fd6df75bb3201074c62 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 5 Sep 2026 19:38:46 +0200 Subject: [PATCH 07/10] Convert mouse click with hold from a tag to a setting instead --- plugin/mouse/mouse_click_with_hold.py | 21 ++++++++++++--------- settings.talon | 8 +++++--- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/plugin/mouse/mouse_click_with_hold.py b/plugin/mouse/mouse_click_with_hold.py index 5fd674a17c..9069f2f06f 100644 --- a/plugin/mouse/mouse_click_with_hold.py +++ b/plugin/mouse/mouse_click_with_hold.py @@ -1,20 +1,23 @@ -from talon import Context, Module, ctrl +from talon import Context, Module, actions, ctrl mod = Module() -mod.tag( - "mouse_click_with_hold", - desc="Hold mouse buttons for 16 ms so clicks register reliably", +mod.setting( + "mouse_click_hold", + type=int, + default=0, + desc="Duration to hold mouse clicks in milliseconds", ) ctx = Context() -ctx.matches = r""" -tag: user.mouse_click_with_hold -""" @ctx.action_class("main") class MainActions: - @staticmethod def mouse_click(button: int = 0): - ctrl.mouse_click(button=button, hold=16000) + hold_duration = actions.settings.get("user.mouse_click_hold") + + if hold_duration < 1: + actions.next(button) + else: + ctrl.mouse_click(button=button, hold=hold_duration * 1000) diff --git a/settings.talon b/settings.talon index 4ed9ca854d..19f9bdc037 100644 --- a/settings.talon +++ b/settings.talon @@ -61,6 +61,11 @@ settings(): # Set the amount to scroll left/right user.mouse_wheel_horizontal_amount = 40 + # Set the duration to hold mouse clicks in milliseconds. 0 means no hold. + # In some full screen applications, particular games, mouse clicks may not be recognized unless held for a short duration. + # Recommended value for such cases is to try with 16 ms. + user.mouse_click_hold = 0 + # If `true`, start mouse grid numbering on the bottom left (vs. top left) user.grids_put_one_bottom_left = true @@ -136,6 +141,3 @@ settings(): # Uncomment the below to enable the experimental window layout commands # defined in window_layout.talon # tag(): user.experimental_window_layout - -# Uncomment the below to hold mouse buttons for 16 ms so clicks register reliably -# tag(): user.mouse_click_with_hold From efbdab87d642e3ecc67e5361de795f125f626b20 Mon Sep 17 00:00:00 2001 From: Nicholas Riley Date: Sat, 5 Sep 2026 17:22:15 -0400 Subject: [PATCH 08/10] Update mouse_click_with_hold.py --- plugin/mouse/mouse_click_with_hold.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/mouse/mouse_click_with_hold.py b/plugin/mouse/mouse_click_with_hold.py index 9069f2f06f..eb741d5afb 100644 --- a/plugin/mouse/mouse_click_with_hold.py +++ b/plugin/mouse/mouse_click_with_hold.py @@ -1,4 +1,4 @@ -from talon import Context, Module, actions, ctrl +from talon import Context, Module, actions, ctrl, settings mod = Module() @@ -15,7 +15,7 @@ @ctx.action_class("main") class MainActions: def mouse_click(button: int = 0): - hold_duration = actions.settings.get("user.mouse_click_hold") + hold_duration = settings.get("user.mouse_click_hold") if hold_duration < 1: actions.next(button) From a55bff44dbf76816b399630d0c85f7c29db975a9 Mon Sep 17 00:00:00 2001 From: Nicholas Riley Date: Sat, 5 Sep 2026 17:24:21 -0400 Subject: [PATCH 09/10] Update settings.talon --- settings.talon | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/settings.talon b/settings.talon index 19f9bdc037..a1d855878b 100644 --- a/settings.talon +++ b/settings.talon @@ -62,8 +62,9 @@ settings(): user.mouse_wheel_horizontal_amount = 40 # Set the duration to hold mouse clicks in milliseconds. 0 means no hold. - # In some full screen applications, particular games, mouse clicks may not be recognized unless held for a short duration. - # Recommended value for such cases is to try with 16 ms. + # In some full-screen applications, particularly games, mouse clicks may not + # be recognized unless held for a short duration. If this occurs, try + # starting with a setting of 16. user.mouse_click_hold = 0 # If `true`, start mouse grid numbering on the bottom left (vs. top left) From 731d9fa68326fe89a8f9d7629431f06e291cefbf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 5 Sep 2026 21:24:31 +0000 Subject: [PATCH 10/10] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- settings.talon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.talon b/settings.talon index a1d855878b..ee075509f8 100644 --- a/settings.talon +++ b/settings.talon @@ -63,7 +63,7 @@ settings(): # Set the duration to hold mouse clicks in milliseconds. 0 means no hold. # In some full-screen applications, particularly games, mouse clicks may not - # be recognized unless held for a short duration. If this occurs, try + # be recognized unless held for a short duration. If this occurs, try # starting with a setting of 16. user.mouse_click_hold = 0