Skip to content

Commit

Permalink
updated documentation, and fixed code layout
Browse files Browse the repository at this point in the history
  • Loading branch information
EPLHREU committed May 6, 2021
1 parent b91829e commit 3b7d2ef
Show file tree
Hide file tree
Showing 84 changed files with 170 additions and 132 deletions.
165 changes: 116 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Emily's Modifier Dictionary

# very much a WIP and looking for feedback and ideas - will change a lot and quickly :)
## much of the documentation is missing as the design in finalised, please ask or look into the python file itself to see what the strokes are (especially the symbols)

## Design

- type every character with any mixture of modifiers available
- do it all in one stroke
- Have a consistent method to type (pretty much) every shortcut
- Do it all in only one stroke
- Hackable and understandable to anyone who finds it useful :)

## Section

Expand All @@ -18,65 +16,134 @@ There are 3 main sections:

![Coloured Layout Diagram](img/layout.png)

### unique ending

Due to fingerspelling existing on the left hand, a uique chord with the right hand must be stroked.
This stroke is used to uniquely identify a dictionary entry chord from any other chord.
By default this is `-LTZ`, this should be strokes with pinky on the `-Z` and ring finger for `-LT`.
Due to physical and practical limitations, this key combination is both difficult to press, and also will generate clashes.
Please check with your dictionary to see what clashes may occur, and potentially change what this stroke is.
With Magnum as I currently use it, the `-LTZ` stroke clashes with only 71 entries, most of which are misstroke entries, so I don't have to worry about it too much.

![Ender Keys Layout Diagram](img/ender.png)

### modifiers

`FRPB` are used to specify the modifier keys to be used against the selected character.
These can all be used in any variation to produced the desired shortcut.

| modifier pattern | modifier |
|---------------------------------------------|-----------|
| ![Control Pattern Diagram](img/control.png) | `control` |
| ![Shift Pattern Diagram](img/shift.png) | `shift` |
| ![super Pattern Diagram](img/super.png) | `super` |
| ![Alt Pattern Diagram](img/alt.png) | `alt` |


### character

Character input is based on fingerspelling and takes up the whole left hand and vowels.
As I use magnum, and expect most others to use plover, you can specify exactly how fingerspelling works in your dictionary with a variable.
Valid fingerspelling entries contain methods from multiple steno theories, hence why there are duplicate entries for some.

| fingerspelling pattern | letter |
|---------------------------------------|---------|
| ![Letter S Diagram](img/letter-s.png) | S |
| ![Letter V Diagram](img/letter-v.png) | V |
| ![Letter A Diagram](img/a.png) | `A` |
| ![Letter B Diagram](img/b.png) | `B` |
| ![Letter C Diagram](img/c.png) | `C` |
| ![Letter D Diagram](img/d.png) | `D` |
| ![Letter E Diagram](img/e.png) | `E` |
| ![Letter F Diagram](img/f.png) | `F` |
| ![Letter G Diagram](img/g.png) | `G` |
| ![Letter H Diagram](img/h.png) | `H` |
| ![Letter I Diagram](img/i.png) | `I` |
| ![Letter I Diagram](img/i-p.png) | `I` |
| ![Letter J Diagram](img/j.png) | `J` |
| ![Letter J Diagram](img/j-p.png) | `J` |
| ![Letter K Diagram](img/k.png) | `K` |
| ![Letter L Diagram](img/l.png) | `L` |
| ![Letter M Diagram](img/m.png) | `M` |
| ![Letter N Diagram](img/n.png) | `N` |
| ![Letter O Diagram](img/o.png) | `O` |
| ![Letter P Diagram](img/f.png) | `P` |
| ![Letter Q Diagram](img/q.png) | `Q` |
| ![Letter R Diagram](img/r.png) | `R` |
| ![Letter S Diagram](img/s.png) | `S` |
| ![Letter T Diagram](img/t.png) | `T` |
| ![Letter U Diagram](img/u.png) | `U` |
| ![Letter V Diagram](img/v.png) | `V` |
| ![Letter W Diagram](img/w.png) | `W` |
| ![Letter X Diagram](img/x.png) | `X` |
| ![Letter Y Diagram](img/y.png) | `Y` |
| ![Letter Z Diagram](img/z.png) | `Z` |
| ![Letter Z Diagram](img/z-p.png) | `Z` |

When `AO` is held, as that's not valid fingerspelling, the bottom row of the left hand (`SKWR`) will turn into binary number input from 0 to 9.

| binary number pattern | number |
|---------------------------------------|---------|
| ![Number 1 Diagram](img/number-1.png) | 1 |
| ![Number 2 Diagram](img/number-2.png) | 2 |
| ![Number 9 Diagram](img/number-9.png) | 9 |

If `TP` (`F`) is also held, the number input will specify function keys, for the likes of `alt-F4`.
| ![Number 1 Diagram](img/1.png) | `1` |
| ![Number 2 Diagram](img/2.png) | `2` |
| ![Number 3 Diagram](img/3.png) | `3` |
| ![Number 4 Diagram](img/4.png) | `4` |
| ![Number 5 Diagram](img/5.png) | `5` |
| ![Number 6 Diagram](img/6.png) | `6` |
| ![Number 7 Diagram](img/7.png) | `7` |
| ![Number 8 Diagram](img/8.png) | `8` |
| ![Number 9 Diagram](img/9.png) | `9` |

If `TP` (`F`) is also held, the number input will specify function number keys.

| binary function number pattern | function |
|--------------------------------|----------|
| ![F5 Diagram](img/F5.png) | F5 |
| ![F11 Diagram](img/F11.png) | F11 |
| ![F1 Diagram](img/F1.png) | `F1` |
| ![F2 Diagram](img/F2.png) | `F2` |
| ![F3 Diagram](img/F3.png) | `F3` |
| ![F4 Diagram](img/F4.png) | `F4` |
| ![F5 Diagram](img/F5.png) | `F5` |
| ![F6 Diagram](img/F6.png) | `F6` |
| ![F7 Diagram](img/F7.png) | `F7` |
| ![F8 Diagram](img/F8.png) | `F8` |
| ![F9 Diagram](img/F9.png) | `F9` |
| ![F10 Diagram](img/F10.png) | `F10` |
| ![F11 Diagram](img/F11.png) | `F11` |
| ![F12 Diagram](img/F12.png) | `F12` |

### switcher

when `*` is used, the left bank will switch from fingerspelling letters, to a reflected and modified symbol dictionary.
This will apply modifiers to all sorts of symbols in addition to just the letters and numbers.

| symbol pattern | output |
|------------------------------------------------|--------|
| ![Exclamation Pattern Diagram](img/exclam.png) | `!` |
| ![Hash Pattern Diagram](img/hash.png) | `#` |

### modifiers

`FRPB` are used to specify the modifier keys to be used against the selected character.

- `R` = `shift`
- `F` = `control`
- `B` = `alt`
- `P` = `super`

These can all be used to add on the relevant modification as needed, with no limit.

| modifier pattern | modifier |
|---------------------------------------------|-----------|
| ![Control Pattern Diagram](img/control.png) | `control` |
| ![Shift Pattern Diagram](img/shift.png) | `shift` |
| ![Alt Pattern Diagram](img/alt.png) | `alt` |
| ![super Pattern Diagram](img/super.png) | `super` |

### unique ending

This stroke is used to uniquely identify a dictionary entry chord from any other chord.
By default this is `-LTZ`, this should be strokes with pinky on the `-Z` and ring finger for `-LT`.
Due to physical and practical limitations, this key combination is both difficult to press, and also will generate clashes.
Please check with your dictionary to see what clashes may occur, and potentially change what this stroke is.
With Magnum as I currently use it, the `-LTZ` stroke clashes with only 71 entries, most of which are misstroke entries, so I don't have to worry about it too much.

![Ender Keys Layout Diagram](img/ender.png)
This will allow you to apply modifiers to symbols.
However, please note:
> Due to the way plover can operate and the way computers receive shortcut keys, when specifying a symbol, you only specify the key it is mapped to in the current keymap. This means that if the symbol is under shift, then you still need to use the shift modifier. For example, `control+shift+1` is not the same as `control+!`, you still need to add in the `shift` modifier.
Additionally, while using the switcher for symbol specification, the `A` and `O` keys are used to specify variants of a perticular symbol, similar to the emily-symbols dictionary.`A` represents adding 1, while `O` represents adding 2 to the entries below.

| symbol pattern | output | name |
|------------------------------------------------|--------|------|
| ![tab Pattern Diagram](img/s-tab.png) | `tab`, `delete`, `backspace`, `escape` | `tab`, `delete`, `backspace`, `escape` |
| ![arrow Pattern Diagram](img/s-arrow.png) | `up`, `left`, `right`, `down` | `up`, `left`, `right`, `down` |
| ![page Pattern Diagram](img/s-page.png) | `pageup`, `end`, `home`, `pagedown` | `pageup`, `end`, `home`, `pagedown` |
| ![blank Pattern Diagram](img/s-blank.png) | `escape`, `tab`, `return`, ` ` | `escape`, `tab`, `return`, `space` |
| ![exclam Pattern Diagram](img/s-blank.png) | `!`, ``, `¬`, `¡` | `exclam`, ``, `notsign`, `exclamdown` |
| ![quotedbl Pattern Diagram](img/s-quotedbl.png) | `"`, ``, ``, `` | `quotedbl`, ``, ``, `` |
| ![numbersign Pattern Diagram](img/s-numbersign.png) | `#`, `®`, `©`, `` | `numbersign`, `registered`, `copyright`, `` |
| ![dollar Pattern Diagram](img/s-dollar.png) | `$`, ``, `¥`, `£` | `dollar`, `euro`, `yen`, `sterling` |
| ![percent Pattern Diagram](img/s-dollar.png) | `%`, ``, ``, `` | `percent`, ``, ``, `` |
| ![ampersand Pattern Diagram](img/s-ampersand.png) | `&`, ``, ``, `` | `ampersand`, ``, ``, `` |
| ![parenleft Pattern Diagram](img/s-parenleft.png) | `(`, `<`, `[`, `{` | `parenleft`, `less`, `bracketleft`, `braceleft` |
| ![parenright Pattern Diagram](img/s-parenright.png) | `)`, `>`, `]`, `}` | `parenright`, `greater`, `bracketright`, `braceright` |
| ![asterisk Pattern Diagram](img/s-asterisk.png) | `*`, `§`, ``, `×` | `asterisk`, `section`, ``, `multiply` |
| ![plus Pattern Diagram](img/s-plus.png) | `+`, ``, ``, `±` | `plus`, `paragraph`, ``, `plusminus` |
| ![comma Pattern Diagram](img/s-comma.png) | `,`, ``, ``, `` | `comma`, ``, ``, `` |
| ![minus Pattern Diagram](img/s-minus.png) | `-`, ``, ``, `` | `minus`, ``, ``, `` |
| ![period Pattern Diagram](img/s-period.png) | `.`, `·`, ``, `` | `period`, `periodcentered`, ``, `` |
| ![slash Pattern Diagram](img/s-slash.png) | `/`, ``, ``, `÷` | `slash`, ``, ``, `division` |
| ![colon Pattern Diagram](img/s-colon.png) | `:`, ``, ``, `` | `colon`, ``, ``, `` |
| ![semicolon Pattern Diagram](img/s-semicolon.png) | `;`, ``, ``, `` | `semicolon`, ``, ``, `` |
| ![equal Pattern Diagram](img/s-equal.png) | `=`, ``, ``, `` | `equal`, ``, ``, `` |
| ![question Pattern Diagram](img/s-question.png) | `?`, ``, `¿`, `` | `question`, ``, `questiondown`, `` |
| ![at Pattern Diagram](img/s-at.png) | `@`, ``, ``, `` | `at`, ``, ``, `` |
| ![backslash Pattern Diagram](img/s-backslash.png) | `\`, ``, ``, `` | `backslash`, ``, ``, `` |
| ![asciicircum Pattern Diagram](img/s-asciicircum.png) | `^`, `«`, `»`, `°` | `asciicircum`, `guillemotleft`, `guillemotright`, `degree` |
| ![grave Pattern Diagram](img/s-grave.png) | `` ` ``, ``, ``, `` | `grave`, ``, ``, `` |
| ![bar Pattern Diagram](img/s-bar.png) | `\|`, ``, ``, `¦` | `bar`, ``, ``, `brokenbar` |
| ![asciitilde Pattern Diagram](img/s-asciitilde.png) | `~`, ``, ``, `` | `asciitilde`, ``, ``, `` |
137 changes: 54 additions & 83 deletions emily-modifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,106 +4,77 @@
# define your ender here
uniqueEnders = ["LTZ"]

# select the fingerspelling dictionary, i use magnum, but expect most others to use plover
spellingMethod = "magnum"

LONGEST_KEY = 1

# fingerspelling dictionary entries for relevant theories
spelling = {
"magnum": {
"A" : "a",
"PW" : "b",
"KR" : "c",
"TK" : "d",
"E" : "e",
"TP" : "f",
"TKPW" : "g",
"H" : "h",
"AOEU" : "i",
"SKWRAEU" : "j",
"K" : "k",
"HR" : "l",
"PH" : "m",
"TPH" : "n",
"O" : "o",
"P" : "p",
"KW" : "q",
"R" : "r",
"S" : "s",
"T" : "t",
"U" : "u",
"SR" : "v",
"W" : "w",
"KP" : "x",
"KWR" : "y",
"STKPWHR" : "z",
},
"plover": {
"A" : "a",
"PW" : "b",
"KR" : "c",
"TK" : "d",
"E" : "e",
"TP" : "f",
"TKPW" : "g",
"H" : "h",
"EU" : "i",
"SKWR" : "j",
"K" : "k",
"HR" : "l",
"PH" : "m",
"TPH" : "n",
"O" : "o",
"P" : "p",
"KW" : "q",
"R" : "r",
"S" : "s",
"T" : "t",
"U" : "u",
"SR" : "v",
"W" : "w",
"KP" : "x",
"KWR" : "y",
"STKPW" : "z",
}
"A" : "a",
"PW" : "b",
"KR" : "c",
"TK" : "d",
"E" : "e",
"TP" : "f",
"TKPW" : "g",
"H" : "h",
"EU" : "i",
"AOEU" : "i", # magnum
"SKWR" : "j",
"SKWRAEU" : "j", # magnum
"K" : "k",
"HR" : "l",
"PH" : "m",
"TPH" : "n",
"O" : "o",
"P" : "p",
"KW" : "q",
"R" : "r",
"S" : "s",
"T" : "t",
"U" : "u",
"SR" : "v",
"W" : "w",
"KP" : "x",
"KWR" : "y",
"STKPW" : "z",
"STKPWHR" : "z", # magnum
}

# same as emily-symbols format, but mirrored for use on the left hand
# same as emily-symbols format, but modified for use on the left hand
symbols = {
"KH" : ["tab", "backspace", "delete", "escape"],
"TR" : ["tab", "delete", "backspace", "escape"],
"KPWR" : ["up", "left", "right", "down"],
"KPWHR" : ["pageup}", "home", "end", "pagedown}"],
"" : ["", "return", "tab", "space"],
"KPWHR" : ["pageup", "end", "home", "pagedown"],
"" : ["escape", "tab", "return", "space"],

# typable symbols
"HR" : ["exclam", "notsign", "", "exclamdown"],
"WH" : ["quotedbl", "", "", ""],
"TKHR" : ["numbersign", "copyright", "registered", ""],
"TPWR" : ["dollar", "yen", "euro", "sterling"],
"HR" : ["exclam", "", "notsign", "exclamdown"],
"PH" : ["quotedbl", "", "", ""],
"TKHR" : ["numbersign", "registered", "copyright", ""],
"KPWH" : ["dollar", "euro", "yen", "sterling"],
"PWHR" : ["percent", "", "", ""],
"PWH" : ["ampersand", "", "", ""],
"SKP" : ["ampersand", "", "", ""],
"H" : ["apostrophe", "", "", ""],
"TPH" : ["parenleft", "bracketleft", "less", "braceleft"],
"KWR" : ["parenright", "bracketright", "greater", "braceright"],
"T" : ["asterisk", "", "section", "multiply"],
"K" : ["plus", "", "paragraph", "plusminus"],
"TPH" : ["parenleft", "less", "bracketleft", "braceleft"],
"KWR" : ["parenright", "greater", "bracketright", "braceright"],
"T" : ["asterisk", "section", "", "multiply"],
"K" : ["plus", "paragraph", "", "plusminus"],
"W" : ["comma", "", "", ""],
"TP" : ["minus", "", "", ""],
"R" : ["period", "", "periodcentered", ""],
"PR" : ["slash", "", "", "division"],
"R" : ["period", "periodcentered", "", ""],
"WH" : ["slash", "", "", "division"],
"TK" : ["colon", "", "", ""],
"WR" : ["semicolon", "", "", ""],
"TKPW" : ["equal", "", "", ""],
"PWL" : ["question", "questiondown", "", ""],
"TPW" : ["question", "", "questiondown", ""],
"TKPWHR" : ["at", "", "", ""],
"WH" : ["backslash", "", "", ""],
"KPR" : ["asciicircum", "guillemotright", "guillemotleft", "degree"],
"PR" : ["backslash", "", "", ""],
"KPR" : ["asciicircum", "guillemotleft", "guillemotright", "degree"],
"KW" : ["underscore", "", "", "mu"],
"P" : ["grave", "", "", ""],
"PW" : ["bar", "", "", "brokenbar"],
"KPWH" : ["asciitilde", "", "", ""]
}
"TPWR" : ["asciitilde", "", "", ""]
}

def lookup(chord):

Expand Down Expand Up @@ -143,13 +114,13 @@ def lookup(chord):
(pattern, variants, vowel2) = secondMatch.groups()
# if the pattern is not recognised, error out
if pattern not in symbols:
raise KeyError
raise KeyError

# calculate the variant count
variant = 0
if 'O' in variants:
variant = variant + 1
if 'A' in variants:
variant = variant + 1
if 'O' in variants:
variant = variant + 2

# get the entry
Expand Down Expand Up @@ -202,9 +173,9 @@ def lookup(chord):
entry = shape + number + vowel2

# check for entry in dictionary
if entry not in spelling[spellingMethod]:
if entry not in spelling:
raise KeyError
character = spelling[spellingMethod][entry]
character = spelling[entry]

# accumulate list of modifiers to be added to the character
# may need to reorder?
Expand Down
Binary file added img/0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Binary file added img/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added img/F1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/F10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/F11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/F12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/F2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/F3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/F4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/F6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/F7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/F8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/F9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/e.png
Binary file removed img/exclam.png
Diff not rendered.
Binary file added img/f.png
Binary file added img/g.png
Binary file added img/h.png
Binary file removed img/hash.png
Diff not rendered.
Binary file added img/i-p.png
Binary file added img/i.png
Binary file added img/j-p.png
Binary file added img/j.png
Binary file added img/k.png
Binary file added img/l.png
Binary file added img/m.png
Binary file added img/n.png
Binary file added img/o.png
Binary file added img/p.png
Binary file added img/q.png
Binary file added img/r.png
Binary file added img/s-ampersand.png
Binary file added img/s-apostrophe.png
Binary file added img/s-arrow.png
Binary file added img/s-asciicircum.png
Binary file added img/s-asciitilde.png
Binary file added img/s-asterisk.png
Binary file added img/s-at.png
Binary file added img/s-backslash.png
Binary file added img/s-bar.png
Binary file added img/s-blank.png
Binary file added img/s-colon.png
Binary file added img/s-comma.png
Binary file added img/s-dollar.png
Binary file added img/s-equal.png
Binary file added img/s-exclam.png
Binary file added img/s-grave.png
Binary file added img/s-minus.png
Binary file added img/s-numbersign.png
Binary file added img/s-page.png
Binary file added img/s-parenleft.png
Binary file added img/s-parenright.png
Binary file added img/s-percent.png
Binary file added img/s-period.png
Binary file added img/s-plus.png
Binary file added img/s-quotedbl.png
Binary file added img/s-qustion.png
Binary file added img/s-semicolon.png
Binary file added img/s-slash.png
Binary file added img/s-tab.png
Binary file added img/s-underscore.png
File renamed without changes
Binary file added img/t.png
Binary file added img/u.png
File renamed without changes
Binary file added img/w.png
Binary file added img/x.png
Binary file added img/y.png
Binary file added img/z-p.png
Binary file added img/z.png

0 comments on commit 3b7d2ef

Please sign in to comment.