From 2f6623ec5d750c53f47912958759843a3fb562a6 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Fri, 4 Aug 2023 17:38:10 +0200 Subject: [PATCH 1/5] Require both terminal and gdb tags (#1243) --- apps/gdb/gdb_active.talon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/gdb/gdb_active.talon b/apps/gdb/gdb_active.talon index 12c6ce246c..ba73105f89 100644 --- a/apps/gdb/gdb_active.talon +++ b/apps/gdb/gdb_active.talon @@ -2,7 +2,7 @@ os: linux # XXX - this matches .gdb files atm #win.title: /gdb/ tag: terminal -tag: user.gdb +and tag: user.gdb - tag(): user.debugger until : "until {number}" From aae6a2dfe9ccea05ff773de0d667c03e2b544ebd Mon Sep 17 00:00:00 2001 From: Nicholas Riley Date: Sat, 12 Aug 2023 12:03:13 -0400 Subject: [PATCH 2/5] Fix broken repo link in README.md (#1247) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 21cff78dfe..1a21b5340a 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Note that it is also possible to install `community` by [downloading and extract 4. `help alphabet` will display the alphabet 5. `command history` will toggle a display of the recent commands 6. `help format` will display the available formatters with examples. -7. Many useful, basic commands are defined in https://github.com/talonhub/community/blob/main/core/edit/standard.talon +7. Many useful, basic commands are defined in https://github.com/talonhub/community/blob/main/core/edit/edit.talon - `undo that` and `redo that` are the default undo/redo commands. - `paste that`, `copy that`, and `cut that` for pasting/copy/cutting, respectively. 8. For community-generated documentation on Talon itself, please visit https://talon.wiki/ From 6a79c63240c76aa51469da281c8a5c4b7854909f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 12 Aug 2023 10:03:49 -0600 Subject: [PATCH 3/5] [pre-commit.ci] pre-commit autoupdate (#1246) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c3fb382c94..c53b54ccdc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,11 +23,11 @@ repos: - id: end-of-file-fixer - id: mixed-line-ending - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v3.0.0" + rev: "v3.0.1" hooks: - id: prettier - repo: https://github.com/ikamensh/flynt/ - rev: "1.0.0" + rev: "1.0.1" hooks: - id: flynt - repo: https://github.com/pycqa/isort @@ -39,7 +39,7 @@ repos: hooks: - id: black - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.1 + rev: v1.5.3 hooks: - id: remove-tabs types: [file] From 6eecbea50a4a7d7da9dbd46bd34381fc3a7abc0a Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 19 Aug 2023 03:45:29 +0200 Subject: [PATCH 4/5] Added hiss noise to scroll down (#1244) Added Talon action `def noise_trigger_hiss(active: bool)` each call to this action is debounced to avoid it triggering during speech. By default there is a disabled mouse continuous scroll down implementation that you can enable with the following setting: `user.mouse_enable_hiss_scroll = 1` --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: David Vo Co-authored-by: splondike --- core/noise.py | 21 ++++++++++++++- plugin/mouse/mouse.py | 62 +++++++++++++++++++++++++++---------------- settings.talon | 3 +++ 3 files changed, 62 insertions(+), 24 deletions(-) diff --git a/core/noise.py b/core/noise.py index 98b3de9f2d..80c61eafae 100644 --- a/core/noise.py +++ b/core/noise.py @@ -2,9 +2,10 @@ Map noises (like pop) to actions so they can have contextually differing behavior """ -from talon import Module, actions, noise +from talon import Module, actions, cron, noise mod = Module() +hiss_cron = None @mod.action_class @@ -16,5 +17,23 @@ def noise_trigger_pop(): example. """ + def noise_trigger_hiss(active: bool): + """ + Called when the user makes a 'hiss' noise. Listen to + https://noise.talonvoice.com/static/previews/hiss.mp3 for an + example. + """ + + +def noise_trigger_hiss_debounce(active: bool): + """Since the hiss noise triggers while you're talking we need to debounce it""" + global hiss_cron + if active: + hiss_cron = cron.after("100ms", lambda: actions.user.noise_trigger_hiss(active)) + else: + cron.cancel(hiss_cron) + actions.user.noise_trigger_hiss(active) + noise.register("pop", lambda _: actions.user.noise_trigger_pop()) +noise.register("hiss", noise_trigger_hiss_debounce) diff --git a/plugin/mouse/mouse.py b/plugin/mouse/mouse.py index 9cf1125934..f67e88c308 100644 --- a/plugin/mouse/mouse.py +++ b/plugin/mouse/mouse.py @@ -58,6 +58,12 @@ default=0, desc="When enabled, pop stops continuous scroll modes (wheel upper/downer/gaze)", ) +setting_mouse_enable_hiss_scroll = mod.setting( + "mouse_enable_hiss_scroll", + type=bool, + default=False, + desc="Hiss noise scrolls down when enabled", +) setting_mouse_wake_hides_cursor = mod.setting( "mouse_wake_hides_cursor", type=int, @@ -249,29 +255,39 @@ def show_cursor_helper(show): ctrl.cursor_visible(show) -@ctx.action("user.noise_trigger_pop") -def on_pop(): - if setting_mouse_enable_pop_stops_scroll.get() >= 1 and (gaze_job or scroll_job): - # Allow pop to stop scroll - stop_scroll() - else: - # Otherwise respect the mouse_enable_pop_click setting - setting_val = setting_mouse_enable_pop_click.get() - - is_using_eye_tracker = ( - actions.tracking.control_zoom_enabled() - or actions.tracking.control_enabled() - or actions.tracking.control1_enabled() - ) - should_click = ( - setting_val == 2 and not actions.tracking.control_zoom_enabled() - ) or ( - setting_val == 1 - and is_using_eye_tracker - and not actions.tracking.control_zoom_enabled() - ) - if should_click: - ctrl.mouse_click(button=0, hold=16000) +@ctx.action_class("user") +class UserActions: + def noise_trigger_pop(): + if setting_mouse_enable_pop_stops_scroll.get() >= 1 and ( + gaze_job or scroll_job + ): + # Allow pop to stop scroll + stop_scroll() + else: + # Otherwise respect the mouse_enable_pop_click setting + setting_val = setting_mouse_enable_pop_click.get() + + is_using_eye_tracker = ( + actions.tracking.control_zoom_enabled() + or actions.tracking.control_enabled() + or actions.tracking.control1_enabled() + ) + should_click = ( + setting_val == 2 and not actions.tracking.control_zoom_enabled() + ) or ( + setting_val == 1 + and is_using_eye_tracker + and not actions.tracking.control_zoom_enabled() + ) + if should_click: + ctrl.mouse_click(button=0, hold=16000) + + def noise_trigger_hiss(active: bool): + if setting_mouse_enable_hiss_scroll.get(): + if active: + actions.user.mouse_scroll_down_continuous() + else: + actions.user.mouse_scroll_stop() def mouse_scroll(amount): diff --git a/settings.talon b/settings.talon index 746e120dea..7470a12c1a 100644 --- a/settings.talon +++ b/settings.talon @@ -24,6 +24,9 @@ settings(): # 2 = on but not with zoom mouse mode user.mouse_enable_pop_click = 1 + # Uncomment the below to enable mouse scroll down using hiss noise + # user.mouse_enable_hiss_scroll = 1 + # When enabled, the 'Scroll Mouse' GUI will not be shown. user.mouse_hide_mouse_gui = 0 From 98ba0bef2db67a39fcfe42640fe5b22090defdc7 Mon Sep 17 00:00:00 2001 From: David Vo Date: Sat, 19 Aug 2023 11:22:11 +0930 Subject: [PATCH 5/5] typescript: Add type operation commands (#1225) This adds a few commands for some TypeScript type operations: - `type union/intersect` after a type to union or intersect it with another type - example: `type union undefined` will make a type possibly undefined ` | undefined` - `state type` to start a `type` statement - `as const` to insert `as const` at the end of an expression --- lang/typescript/typescript.talon | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lang/typescript/typescript.talon b/lang/typescript/typescript.talon index 80e949282a..c99fc11310 100644 --- a/lang/typescript/typescript.talon +++ b/lang/typescript/typescript.talon @@ -1,3 +1,10 @@ tag: user.typescript - tag(): user.javascript + +type union []: " | {code_type or ''}" +type intersect []: " & {code_type or ''}" + +state type: user.insert_between("type ", " = ") + +as const: " as const"