-
Notifications
You must be signed in to change notification settings - Fork 26
/
gaze_ocr.talon
102 lines (97 loc) · 4.6 KB
/
gaze_ocr.talon
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
mode: command
# Optional: to use these commands in dictation mode, either use "mixed mode" (enable both dictation
# and command mode simultaneously) or define a new dictation_command mode and enable it alongside
# dictation mode. The following line will have no effect if dictation_command is not defined.
mode: user.dictation_command
-
# Commands that operate wherever you are looking.
# Example: "eye hover" to hover the cursor over where you're looking.
(eye | i) (hover | [cursor] move): user.move_cursor_to_gaze_point()
(eye | i) [left] (touch | click):
user.move_cursor_to_gaze_point()
mouse_click(0)
(eye | i) [left] double (touch | click):
user.move_cursor_to_gaze_point()
mouse_click(0)
mouse_click(0)
(eye | i) right (touch | click):
user.move_cursor_to_gaze_point()
mouse_click(1)
(eye | i) middle (touch | click):
user.move_cursor_to_gaze_point()
mouse_click(2)
# Example: "eye control click" to control-click where you're looking.
(eye | i) <user.modifiers> (touch | click):
user.move_cursor_to_gaze_point()
key("{modifiers}:down")
mouse_click(0)
key("{modifiers}:up")
(eye | i) scroll up:
user.move_cursor_to_gaze_point(0, 40)
user.mouse_scroll_up()
(eye | i) scroll up half:
user.move_cursor_to_gaze_point(0, 40)
user.mouse_scroll_up(0.5)
(eye | i) scroll down:
user.move_cursor_to_gaze_point(0, -40)
user.mouse_scroll_down()
(eye | i) scroll down half:
user.move_cursor_to_gaze_point(0, -40)
user.mouse_scroll_down(0.5)
(eye | i) scroll left:
user.move_cursor_to_gaze_point(40, 0)
user.mouse_scroll_left()
(eye | i) scroll left half:
user.move_cursor_to_gaze_point(40, 0)
user.mouse_scroll_left(0.5)
(eye | i) scroll right:
user.move_cursor_to_gaze_point(-40, 0)
user.mouse_scroll_right()
(eye | i) scroll right half:
user.move_cursor_to_gaze_point(-40, 0)
user.mouse_scroll_right(0.5)
# Debugging commands.
ocr show [text]: user.show_ocr_overlay("text")
ocr show [text] near <user.timestamped_prose>: user.show_ocr_overlay("text", timestamped_prose)
ocr show boxes: user.show_ocr_overlay("boxes")
# Commands that operate on text nearby where you're looking.
# Example: "hover seen apple" to hover the cursor over the word "apple".
(hover (seen | scene) | cursor move) <user.timestamped_prose>$: user.move_cursor_to_word(timestamped_prose)
# Example: "touch apple" to click the word "apple".
[left] (touch | click) <user.timestamped_prose>$:
user.click_text(timestamped_prose)
[left] double (touch | click) <user.timestamped_prose>$:
user.double_click_text(timestamped_prose)
right (touch | click) <user.timestamped_prose>$:
user.right_click_text(timestamped_prose)
middle (touch | click) <user.timestamped_prose>$:
user.middle_click_text(timestamped_prose)
<user.modifiers> (touch | click) <user.timestamped_prose>$:
user.modifier_click_text(modifiers, timestamped_prose)
# Example: "go before apple" to move the text cursor before the word "apple".
(go before | pre (seen | scene)) <user.timestamped_prose>$: user.move_text_cursor_to_word(timestamped_prose, "before")
(go after | post (seen | scene)) <user.timestamped_prose>$: user.move_text_cursor_to_word(timestamped_prose, "after")
# Examples:
# "select apple" to select the word "apple".
# "select apple through banana" to select the phrase "apple pear banana".
# "select through before apple" to select from the text cursor position to before the word "apple".
select <user.prose_range>$:
user.perform_ocr_action("select", "", prose_range)
# Examples:
# "take seen apple" to select the word "apple".
# "copy seen apple through banana" to copy the phrase "apple pear banana".
# "copy all seen apple" to copy all text from the field containing the word "apple".
{user.ocr_actions} [{user.ocr_modifiers}] (seen | scene) <user.prose_range>$:
user.perform_ocr_action(ocr_actions, ocr_modifiers or "", prose_range)
# Example: "replace apple with banana" to replace the word "apple" with the word "banana".
replace [{user.ocr_modifiers}] [seen | scene] <user.prose_range> with <user.prose>$:
user.replace_text(ocr_modifiers or "", prose_range, prose)
[go] before <user.timestamped_prose> say <user.prose>$:
user.insert_adjacent_to_text(timestamped_prose, "before", prose)
[go] after <user.timestamped_prose> say <user.prose>$:
user.insert_adjacent_to_text(timestamped_prose, "after", prose)
phones [word] (seen | scene) <user.timestamped_prose>$:
user.change_text_homophone(timestamped_prose)
ocr tracker on: user.connect_ocr_eye_tracker()
ocr tracker off: user.disconnect_ocr_eye_tracker()
# More commands are available for Talon Beta users! Simply switch to the "beta" branch.