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.
Support for Foxit Reader for PDFs (talonhub#1403)
Adds basic support for the foxit reader on windows. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jeff Knaus <knaus.jeff@gmail.com>
- Loading branch information
1 parent
679bdfb
commit 5e1e579
Showing
2 changed files
with
75 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") |
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,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) |