forked from mrob95/mathfly-talon
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
scientific_notebook_55.py
72 lines (64 loc) · 1.45 KB
/
scientific_notebook_55.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from talon import Module, Context, actions
mod = Module()
ctx = Context()
ctx.matches = r"""
app: scinoteb.exe
"""
ctx.lists["user.greek_letters"] = {
# Lowercase
"alpha": "a",
"beater": "b",
"gamma": "g",
"delta": "d",
"epsilon": "e",
"zita": "z",
"eater": "h",
"theta": "y",
"iota": "i",
"kappa": "k",
"lambda": "l",
"mu": "m",
"new": "n",
"zee": "x",
"pie": "p",
"row": "r",
"sigma": "s",
"tau": "t",
"upsilon": "u",
"phi": "f",
"chi": "q",
"sigh": "c",
"omega": "w",
"gamma": "g",
# Capitals
"big delta": "D",
"big lambda": "L",
"big pie": "P",
"big sigma": "S",
"big upsilon": "U",
"big phi": "F",
"big sigh": "C",
"big omega": "W",
}
@ctx.action_class("user")
class Actions:
def maths_greek_letter(letter: str):
actions.key(f"ctrl-g {letter}")
def maths_tex_symbol(symbol: str):
actions.key("ctrl:down")
actions.insert(symbol)
actions.key("ctrl:up")
def maths_matrix(rows: int, columns: int):
actions.key("f10")
actions.sleep("50ms")
actions.key("i down:8 enter")
actions.insert(rows)
actions.key("tab")
actions.insert(columns)
actions.key("enter")
def maths_fraction():
actions.key("ctrl-f")
def maths_begin_superscript():
actions.key("ctrl-h")
def maths_begin_subscript():
actions.key("ctrl-l")