Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add user setting for hiss debounce time #1700

Merged
merged 4 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions core/noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@
Map noises (like pop) to actions so they can have contextually differing behavior
"""

from talon import Module, actions, cron, noise
from talon import Module, actions, cron, noise, settings

mod = Module()
hiss_cron = None

mod.setting(
"hiss_scroll_debounce_time",
type=int,
default=100,
desc="How much time a hiss must last for to be considered a hiss rather than part of speech, in ms",
)


@mod.action_class
class Actions:
Expand All @@ -31,7 +38,10 @@ 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))
hiss_cron = cron.after(
str(settings.get("user.hiss_scroll_debounce_time")) + "ms",
knausj85 marked this conversation as resolved.
Show resolved Hide resolved
lambda: actions.user.noise_trigger_hiss(active),
)
else:
cron.cancel(hiss_cron)
actions.user.noise_trigger_hiss(active)
Expand Down
4 changes: 4 additions & 0 deletions settings.talon
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ settings():
# If `true`, use a hissing noise to scroll continuously
user.mouse_enable_hiss_scroll = 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

# If `true`, hide the continuous scroll/gaze scroll GUI
user.mouse_hide_mouse_gui = false

Expand Down
Loading