diff --git a/core/modes/sleep_mode.talon b/core/modes/sleep_mode.talon index 6284becb16..4a0d9c1d9b 100644 --- a/core/modes/sleep_mode.talon +++ b/core/modes/sleep_mode.talon @@ -7,3 +7,32 @@ settings(): user.mouse_enable_pop_click = 0 # Stop mouse scroll down using hiss noise user.mouse_enable_hiss_scroll = 0 + +#================================================================================ +# Commands to wake Talon +#================================================================================ + +# Note: these have repeaters on them (+) to work around an issue where, in sleep mode, +# you can get into a situation where these commands are difficult to trigger. + +# These commands are fully anchored (^ and $), which means that there must be +# silence before and after saying them in order for them to recognize (this reduces +# false positives during normal sleep mode, normally a good thing). + +# However, ignored background speech during sleep mode also counts as an utterance. + +# Thus, if you say "blah blah blah talon wake", these won't trigger, because "blah +# blah blah" was part of the same utterance. You have to say "blah blah blah" , "talon wake" . + +# Sometimes people would forget the second pause, notice things weren't working, and +# say "talon wake" over and over again before the speech timeout ever gets hit, which +# means that these won't recognize. The (+) handles this case, so if you say +# "talon wake talon wake" , it'll still work. + +^(welcome back)+$: + user.mouse_wake() + user.history_enable() + user.talon_mode() + +^(talon wake)+$: speech.enable() diff --git a/core/modes/sleep_mode_not_dragon.talon b/core/modes/sleep_mode_not_dragon.talon new file mode 100644 index 0000000000..a4b305c975 --- /dev/null +++ b/core/modes/sleep_mode_not_dragon.talon @@ -0,0 +1,9 @@ +mode: sleep +not speech.engine: dragon +- +# 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() diff --git a/core/modes/to_sleep_mode.talon b/core/modes/to_sleep_mode.talon new file mode 100644 index 0000000000..8fbfcf4b08 --- /dev/null +++ b/core/modes/to_sleep_mode.talon @@ -0,0 +1,26 @@ +mode: command +mode: dictation +- + +# The optional 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 in the body of the command. + +^sleep all []$: + user.switcher_hide_running() + user.history_disable() + user.homophones_hide() + user.help_hide() + user.mouse_sleep() + speech.disable() + user.engine_sleep() + +^talon sleep []$: speech.disable() diff --git a/core/modes/to_sleep_mode_not_dragon.talon b/core/modes/to_sleep_mode_not_dragon.talon new file mode 100644 index 0000000000..a412853e92 --- /dev/null +++ b/core/modes/to_sleep_mode_not_dragon.talon @@ -0,0 +1,12 @@ +mode: command +mode: dictation +not speech.engine: dragon +- +# 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. +# +# For a note about the optional , see to_sleep_mode.talon. +^go to sleep []$: speech.disable() diff --git a/core/modes/wake_and_sleep.talon b/core/modes/wake_and_sleep.talon deleted file mode 100644 index 8c2cdd7dff..0000000000 --- a/core/modes/wake_and_sleep.talon +++ /dev/null @@ -1,17 +0,0 @@ -#defines the commands that sleep/wake Talon -mode: all -- -^(welcome back)+$: - user.mouse_wake() - user.history_enable() - user.talon_mode() -^sleep all []$: - user.switcher_hide_running() - user.history_disable() - user.homophones_hide() - user.help_hide() - user.mouse_sleep() - speech.disable() - user.engine_sleep() -^talon sleep []$: speech.disable() -^(talon wake)+$: speech.enable() diff --git a/core/modes/wake_and_sleep_wav2letter.talon b/core/modes/wake_and_sleep_wav2letter.talon deleted file mode 100644 index 9d93c741fd..0000000000 --- a/core/modes/wake_and_sleep_wav2letter.talon +++ /dev/null @@ -1,5 +0,0 @@ -mode: all -speech.engine: wav2letter -- -^go to sleep []$: speech.disable() -^(wake up)+$: speech.enable()