diff --git a/apps/foxit_reader/foxit_reader.py b/apps/foxit_reader/foxit_reader.py new file mode 100644 index 0000000000..29131695c1 --- /dev/null +++ b/apps/foxit_reader/foxit_reader.py @@ -0,0 +1,64 @@ +from talon import Context, Module, actions + +mod = Module() +ctx = Context() + +# --- App definition --- +mod.apps.foxit_reader = r""" +os: windows +and app.name: /^Foxit Reader/ +os: windows +and app.exe: /^foxitreader\.exe$/i +os: windows +and app.name: Foxit PDF Reader +os: windows +and app.exe: /^foxitpdfreader\.exe$/i +""" +# Context matching +ctx.matches = """ +app: foxit_reader +""" + + +@ctx.action_class("app") +class AppActions: + # app.tabs + def tab_open(): + actions.key("ctrl-o") + + def tab_reopen(): + actions.app.notify("Foxit does not support this action.") + + +@ctx.action_class("user") +class UserActions: + # user.tabs + def tab_jump(number): + actions.app.notify("Foxit does not support this action.") + + def tab_final(): + actions.app.notify("Foxit does not support this action.") + + def tab_duplicate(): + actions.app.notify("Foxit does not support this action.") + + # user.pages + def page_current() -> int: + actions.key("ctrl-g") + page = actions.edit.selected_text() + return int(page) + + def page_next(): + actions.key("right") + + def page_previous(): + actions.key("left") + + def page_jump(number: int): + actions.key("ctrl-g") + actions.insert(str(number)) + actions.key("enter") + + def page_final(): + # actions.key("fn-right") + actions.key("end") diff --git a/apps/foxit_reader/foxit_reader.talon b/apps/foxit_reader/foxit_reader.talon new file mode 100644 index 0000000000..1ce5026597 --- /dev/null +++ b/apps/foxit_reader/foxit_reader.talon @@ -0,0 +1,11 @@ +app: foxit_reader +- +tag(): user.tabs +tag(): user.pages + +tab close all: key(ctrl-shift-w) + +[page] rotate right: key("shift-ctrl-keypad_equals") +[page] rotate left: key("shift-ctrl-keypad_minus") + +go back: key(alt-left)