forked from talonhub/community
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Catch redundant sleep/wake commands, and notify the user that Talon i…
…s already in the requested mode (talonhub#1327) This commit adds some commands to catch redundant sleep/wake commands, and notifies the user. The main example is, if Talon is already awake, the "talon wake" and "wake up" commands aren't active. So if the user is unsure of their current mode and says "wake up", Talon interprets the command as something else ("page up", for example). These new commands are active in the mode the user is trying to activate. They catch the command, and trigger an `app.notify` to let the user know they're already in that mode. Before talonhub#1215, these were bound with `mode: all`, so using them in the wrong mode would still be recognized, but just no-op. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Phil Cohen <phillip@phillip.io> Co-authored-by: Jeff Knaus <knaus.jeff@gmail.com>
- Loading branch information
1 parent
aaa62f0
commit de711f0
Showing
6 changed files
with
69 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
mode: sleep | ||
not mode: sleep | ||
not speech.engine: dragon | ||
- | ||
# The optional <phrase> afterwards allows these to match even if you say arbitrary text | ||
# after this command, without having to wait for the speech timeout. | ||
|
||
# This is handy because you often need to put Talon asleep in order to immediately | ||
# talk to humans, and it's annoying to have to say "sleep all", wait for the timeout, | ||
# and then resume your conversation. | ||
|
||
# With this, you can say "sleep all hey bob" and Talon will immediately go to | ||
# sleep and ignore "hey bob". Note that subtitles will show "sleep all hey bob", | ||
# because it's part of the rule definition, but "hey bob" will be ignored, because | ||
# we don't do anything with the <phrase> in the body of the command. | ||
|
||
^talon wake [<phrase>]$: speech.enable() | ||
|
||
# We define this *only* if the speech engine isn't Dragon, because if you're using Dragon, | ||
# "wake up" is used to specifically control Dragon, and not affect Talon. | ||
# | ||
# It's a useful and well known command, though, so if you're using any other speech | ||
# engine, this controls Talon. | ||
^(wake up)+$: speech.enable() | ||
|
||
# We define this *only* if the speech engine isn't Dragon, because if you're using Dragon, | ||
# "go to sleep" is used to specifically control Dragon, and not affect Talon. | ||
# | ||
# It's a useful and well known command, though, so if you're using any other speech | ||
# engine, this controls Talon. | ||
^go to sleep [<phrase>]$: speech.disable() | ||
^talon sleep [<phrase>]$: speech.disable() | ||
|
||
^sleep all [<phrase>]$: | ||
user.switcher_hide_running() | ||
user.history_disable() | ||
user.homophones_hide() | ||
user.help_hide() | ||
user.mouse_sleep() | ||
speech.disable() | ||
user.engine_sleep() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,5 +34,3 @@ settings(): | |
user.mouse_wake() | ||
user.history_enable() | ||
user.talon_mode() | ||
|
||
^(talon wake)+$: speech.enable() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.