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.
Unify go back and go forward implementations (talonhub#1490)
This implements standardized go back and go forward voice commands as well as matching actions to be used in applications system wide --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
2c18a5f
commit 9498ffc
Showing
11 changed files
with
56 additions
and
36 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
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
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,43 @@ | ||
from talon import Context, Module, actions | ||
|
||
mod = Module() | ||
mod.tag("navigation") | ||
|
||
ctx_browser = Context() | ||
ctx_browser.matches = r""" | ||
tag: browser | ||
""" | ||
|
||
ctx_mac = Context() | ||
ctx_mac.matches = r""" | ||
os: mac | ||
""" | ||
|
||
|
||
@ctx_browser.action_class("user") | ||
class BrowserActions: | ||
def go_back(): | ||
actions.browser.go_back() | ||
|
||
def go_forward(): | ||
actions.browser.go_forward() | ||
|
||
|
||
@ctx_mac.action_class("user") | ||
class MacActions: | ||
def go_back(): | ||
actions.key("cmd-]") | ||
|
||
def go_forward(): | ||
actions.key("cmd-[") | ||
|
||
|
||
@mod.action_class | ||
class Actions: | ||
def go_back(): | ||
"""Navigate back""" | ||
actions.key("alt-left") | ||
|
||
def go_forward(): | ||
"""Navigate forward""" | ||
actions.key("alt-right") |
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,5 @@ | ||
tag: user.navigation | ||
- | ||
|
||
go back: user.go_back() | ||
go forward: user.go_forward() |
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