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

Catch redundant sleep/wake commands, and notify the user that Talon is already in the requested mode #1327

Merged
merged 15 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from 9 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
5 changes: 5 additions & 0 deletions core/modes/modes.talon
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ not mode: sleep
mode.disable("sleep")
mode.disable("dictation")
mode.enable("command")

# Normally, the wake commands are only bound in sleep mode.
# However, sometimes people accidentally use them if Talon is already active, and if they're not bound, they'll likely be recognized as a different command (like "page up").
# So we bind them here, and show a notification instead to guide the user.
^(wake up | talon wake)+$: app.notify("Talon is already awake")
4 changes: 4 additions & 0 deletions core/modes/sleep_mode.talon
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ settings():
user.talon_mode()

^(talon wake)+$: speech.enable()

# Catch the redundant sleep command, and notify the user that Talon is already asleep.
# For a note about the optional <phrase>, see to_sleep_mode.talon.
^(talon | go to) sleep [<phrase>]$: app.notify("Talon is already asleep")
knausj85 marked this conversation as resolved.
Show resolved Hide resolved