init commit
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
from talon import Module
|
||||
|
||||
# --- App definition ---
|
||||
mod = Module()
|
||||
mod.apps.kindle = r"""
|
||||
os: windows
|
||||
and app.name: Kindle
|
||||
os: windows
|
||||
and app.exe: /^kindle\.exe$/i
|
||||
"""
|
||||
# TODO: mac context and implementation
|
||||
@@ -0,0 +1,4 @@
|
||||
app: kindle
|
||||
-
|
||||
# Set tags
|
||||
tag(): user.pages
|
||||
@@ -0,0 +1,24 @@
|
||||
from talon import Context, actions
|
||||
|
||||
# Context matching
|
||||
ctx = Context()
|
||||
ctx.matches = """
|
||||
os: windows
|
||||
app: kindle
|
||||
"""
|
||||
|
||||
|
||||
# --- Implement actions ---
|
||||
@ctx.action_class("user")
|
||||
class UserActions:
|
||||
# user.pages
|
||||
def page_next():
|
||||
actions.key("down")
|
||||
|
||||
def page_previous():
|
||||
actions.key("up")
|
||||
|
||||
def page_jump(number: int):
|
||||
actions.key("ctrl-g")
|
||||
actions.insert(str(number))
|
||||
actions.key("enter")
|
||||
Reference in New Issue
Block a user