-
Notifications
You must be signed in to change notification settings - Fork 783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Talon v0.4 support: port from resource.open to resource.watch & initial talon-list conversions #1239
Closed
Closed
Talon v0.4 support: port from resource.open to resource.watch & initial talon-list conversions #1239
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c1456e9
initial conversions
knausj85 76ba15f
work
knausj85 6b80be6
merge in #1199
knausj85 12d6bbb
Update keys.py
knausj85 5a92278
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] af1d9c7
Update __init__.py
knausj85 7b09a4a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 80de24c
Update core/text/prose_snippets.talon-list
knausj85 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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,6 @@ | ||
list: user.arrow_key | ||
- | ||
down: down | ||
left: left | ||
right: right | ||
up: up | ||
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,26 @@ | ||
list: user.function_key | ||
- | ||
f one: f1 | ||
f two: f2 | ||
f three: f3 | ||
f four: f4 | ||
f five: f5 | ||
f six: f6 | ||
f seven: f7 | ||
f eight: f8 | ||
f nine: f9 | ||
f ten: f10 | ||
f eleven: f11 | ||
f twelve: f12 | ||
f thirteen: f13 | ||
f fourteen: f14 | ||
f fifteen: f15 | ||
f sixteen: f16 | ||
f seventeen: f17 | ||
f eighteen: f18 | ||
f nineteen: f19 | ||
f twenty: f20 | ||
f twenty one: f21 | ||
f twenty two: f22 | ||
f twenty three: f23 | ||
f twenty four: f24 | ||
knausj85 marked this conversation as resolved.
Show resolved
Hide resolved
|
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,19 @@ | ||
list: user.keypad_key | ||
- | ||
key pad zero: keypad_0 | ||
key pad one: keypad_1 | ||
key pad two: keypad_2 | ||
key pad three: keypad_3 | ||
key pad four: keypad_4 | ||
key pad five: keypad_5 | ||
key pad six: keypad_6 | ||
key pad seven: keypad_7 | ||
key pad eight: keypad_8 | ||
key pad nine: keypad_9 | ||
key pad dot: keypad_decimal | ||
key pad plus: keypad_plus | ||
key pad minus: keypad_minus | ||
key pad plex: keypad_multiply | ||
key pad slash: keypad_divide | ||
key pad equals: keypad_equals | ||
key pad clear: keypad_clear |
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 |
---|---|---|
|
@@ -2,28 +2,17 @@ | |
|
||
from ..user_settings import get_list_from_csv | ||
|
||
|
||
def setup_default_alphabet(): | ||
"""set up common default alphabet. | ||
|
||
no need to modify this here, change your alphabet using alphabet.csv""" | ||
initial_default_alphabet = "air bat cap drum each fine gust harp sit jury crunch look made near odd pit quench red sun trap urge vest whale plex yank zip".split() | ||
initial_letters_string = "abcdefghijklmnopqrstuvwxyz" | ||
initial_default_alphabet_dict = dict( | ||
zip(initial_default_alphabet, initial_letters_string) | ||
) | ||
|
||
return initial_default_alphabet_dict | ||
|
||
|
||
alphabet_list = get_list_from_csv( | ||
"alphabet.csv", ("Letter", "Spoken Form"), setup_default_alphabet() | ||
default_digits = "zero one two three four five six seven eight nine".split(" ") | ||
numbers = [str(i) for i in range(10)] | ||
default_f_digits = ( | ||
"one two three four five six seven eight nine ten eleven twelve".split(" ") | ||
Comment on lines
+5
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Merge error, can be removed. |
||
) | ||
|
||
# used for number keys & function keys respectively | ||
digits = "zero one two three four five six seven eight nine".split() | ||
f_digits = "one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen twenty".split() | ||
|
||
|
||
mod = Module() | ||
mod.list("letter", desc="The spoken phonetic alphabet") | ||
mod.list("symbol_key", desc="All symbols from the keyboard") | ||
|
@@ -32,6 +21,7 @@ def setup_default_alphabet(): | |
mod.list("modifier_key", desc="All modifier keys") | ||
mod.list("function_key", desc="All function keys") | ||
mod.list("special_key", desc="All special keys") | ||
mod.list("keypad_key", desc="all keypad keys") | ||
mod.list("punctuation", desc="words for inserting punctuation into text") | ||
|
||
|
||
|
@@ -59,6 +49,12 @@ def number_key(m) -> str: | |
return m.number_key | ||
|
||
|
||
@mod.capture(rule="{self.keypad_key}") | ||
def keypad_key(m) -> str: | ||
"One keypad key" | ||
return m.keypad_key | ||
|
||
|
||
@mod.capture(rule="{self.letter}") | ||
def letter(m) -> str: | ||
"One letter key" | ||
|
@@ -91,7 +87,7 @@ def any_alphanumeric_key(m) -> str: | |
|
||
@mod.capture( | ||
rule="( <self.letter> | <self.number_key> | <self.symbol_key> " | ||
"| <self.arrow_key> | <self.function_key> | <self.special_key> )" | ||
"| <self.arrow_key> | <self.function_key> | <self.special_key> | <self.keypad_key>)" | ||
) | ||
def unmodified_key(m) -> str: | ||
"A single key with no modifiers" | ||
|
@@ -132,7 +128,6 @@ def letters(m) -> str: | |
modifier_keys["command"] = "cmd" | ||
modifier_keys["option"] = "alt" | ||
ctx.lists["self.modifier_key"] = modifier_keys | ||
ctx.lists["self.letter"] = alphabet_list | ||
|
||
# `punctuation_words` is for words you want available BOTH in dictation and as key names in command mode. | ||
# `symbol_key_words` is for key names that should be available in command mode, but NOT during dictation. | ||
|
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,28 @@ | ||
list: user.letter | ||
- | ||
air: a | ||
bat: b | ||
cap: c | ||
drum: d | ||
each: e | ||
fine: f | ||
gust: g | ||
harp: h | ||
sit: i | ||
jury: j | ||
crunch: k | ||
look: l | ||
made: m | ||
near: n | ||
odd: o | ||
pit: p | ||
quench: q | ||
red: r | ||
sun: s | ||
trap: t | ||
urge: u | ||
vest: v | ||
whale: w | ||
plex: x | ||
yank: y | ||
zip: z |
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,9 @@ | ||
list: user.modifier_key | ||
os: mac | ||
- | ||
alt: alt | ||
control: ctrl | ||
shift: shift | ||
super: super | ||
command: cmd | ||
option: alt |
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,17 @@ | ||
list: user.special_key | ||
os: mac | ||
- | ||
end: end | ||
enter: enter | ||
escape: escape | ||
home: home | ||
insert: insert | ||
pagedown: pagedown | ||
pageup: pageup | ||
space: space | ||
tab: tab | ||
wipe: backspace | ||
delete: backspace | ||
forward delete: delete | ||
page up: pageup | ||
page down: pagedown |
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,12 @@ | ||
list: user.number_key | ||
- | ||
zero: 0 | ||
one: 1 | ||
two: 2 | ||
three: 3 | ||
four: 4 | ||
five: 5 | ||
six: 6 | ||
seven: 7 | ||
eight: 8 | ||
nine: 9 |
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,29 @@ | ||
list: user.punctuation | ||
- | ||
`: ` | ||
Comment on lines
+2
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be moved to a dragon specific punctuation list. |
||
,: , | ||
back tick: ` | ||
comma: , | ||
coma: , | ||
period: . | ||
full stop: . | ||
semicolon: ; | ||
colon: : | ||
forward slash: / | ||
question mark: ? | ||
exclamation mark: ! | ||
exclamation point: ! | ||
asterisk: * | ||
hash sign: # | ||
number sign: # | ||
percent sign: % | ||
at sign: @ | ||
and sign: & | ||
ampersand: & | ||
dollar sign: $ | ||
pound sign: £ | ||
hyphen: - | ||
L paren: ( | ||
left paren: ( | ||
R paren: ) | ||
right paren: ) |
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,8 @@ | ||
list: user.modifier_key | ||
os: windows | ||
os: linux | ||
- | ||
alt: alt | ||
control: ctrl | ||
shift: shift | ||
super: super |
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,20 @@ | ||
list: user.special_key | ||
os: windows | ||
os: linux | ||
- | ||
end: end | ||
enter: enter | ||
escape: escape | ||
home: home | ||
insert: insert | ||
pagedown: pagedown | ||
pageup: pageup | ||
space: space | ||
tab: tab | ||
wipe: backspace | ||
delete: backspace | ||
forward delete: delete | ||
page up: pageup | ||
page down: pagedown | ||
menu key: menu | ||
print screen: printscr |
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,24 @@ | ||
list: user.punctuation | ||
mode: dictation | ||
- | ||
back tick: ` | ||
comma: , | ||
# Workaround for issue with conformer b-series; see #946 | ||
coma: , | ||
period: . | ||
full stop: . | ||
semicolon: ; | ||
colon: : | ||
forward slash: / | ||
question mark: ? | ||
exclamation mark: ! | ||
exclamation point: ! | ||
asterisk: * | ||
number sign: # | ||
percent sign: % | ||
at sign: @ | ||
and sign: & | ||
ampersand: & | ||
# Currencies | ||
dollar sign: $ | ||
pound sign: £ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just do
up
instead ofup: up
in all of these identity mapped lists. With up: up it's actually kind of confusing which side to edit too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's arguably a bit more convenient for those that may customize to keep up: up though.
This is a similar problem to eg https://github.com/talonhub/community/blob/7b09a4a789ed1dc380865d2840a5abda9f65af25/core/windows_and_tabs/window_snap_positions.talon-list
where we may be better off with something more obviously not a spoken form on the right side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
up: up
is not more convenient at all, because it's not obvious which side to edit when the sides are symmetrical. I think using a non spoken form on the right hand side is also bad (in the case of key mappings), because the right hand side is a key name. You shouldn't map those to something else.up
on a line by itself should be fine. It's easy enough to teach people how to work with these files I think. We're still much better off than the "simple key names" in Python where you had to move the key to a different list if you wanted to remap it.If the file contains:
I want to remove "up" and add "shoop" mapped to up. I need to know what the existing lines in the
.talon-list
mean, and I need to know how to add a line. I need to know this regardless of whether the file containsup: up
or justup
.Anyway. Don't do
up: up
. Not worth bike shedding.