Skip to content

Commit

Permalink
number mode: NM
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenmoor committed Sep 27, 2023
1 parent 3181bd5 commit ba687a9
Show file tree
Hide file tree
Showing 6 changed files with 542 additions and 533 deletions.
4 changes: 2 additions & 2 deletions cms-content/SystemDE/TextEN/Stage15-1_Plover-Commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ the system will output the word uncapitalized and leave the decision to you.
| | `F- ` | retroactively delete space | {*!} |
| . | `+- ` | full stop: period | {^.}{-|} |
| : | `M- ` | attach colon | {^:} |
| : | `NM- ` | colon and capitalize | {^:}{-|} |
| : | `SM- ` | colon and capitalize | {^:}{-|} |
| ? | `N+- ` | question mark and capitalize | {^?}{-|} |
| ! | `NL- ` | exclamation mark and capitalize | {^!}{-|} |
| # | `N+- ` | hash with next word attached | {\#^} |
Expand Down Expand Up @@ -101,7 +101,7 @@ All but the first follow the same scheme: `DSN+-` plus some letter related to th
| `DSN+-S` | {PLOVER:SUGGESTIONS} |
| `DSN+-F` | {PLOVER:FOCUS} |
| `DSN+-G` | {PLOVER:CONFIGURE} |
| `DSN++G` | {PLOVER:CONFIGURE} |
| `DSN++G` | {PLOVER:QUIT} |
| | |

Sooner or later you will add your own dictionary entries, or make adjustments to the default.
Expand Down
2 changes: 1 addition & 1 deletion cms-content/SystemDE/TextEN/Stage15-3_Number-Mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

For typing numbers, the virtual keyboard above can assist you quite a bit.
Click on "Show special modes" to activate visualization of special input.
Then just hold down `B+-` and you can see, how to reach numbers and related symbols.
Then just hold down `NM-` and you can see, how to reach numbers and related symbols.

![The palantype virtual keyboard in number mode](https://raw.githubusercontent.com/rubenmoor/learn-palantype/main/cms-content/SystemDE/media/numbermode.png)

Expand Down
47 changes: 47 additions & 0 deletions cms-content/SystemDE/TextEN/Stage15-4_Command-Keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,50 @@ this isn't really any strict limit.
For this particular key combination, there exists already a steno code in the command keys:

`N++NSD`

### Collisions and exclusions

Unfortunately, some of the steno codes that are implied by the command key mode
are already in use.
When a steno code has competing meanings, there is a collision that needs resolution.
Here is a list of all collisions:

| steno code | command | word |
|--------------|--------------|--------------|
| A+S | WIN + a ||
| A+SD | WIN + A | aßt |
| A+ʃD | CTRL + A | acht |
| E+ʃD | CTRL + E | echt |
| FG+O | ALT + F12 | quo |
| SG+I | WIN + F11 | Ski |
| ʃG+O | CTRL + F12 | zwo |

If there were a lot of collisions, we would have to reconsider the choice of
characters that trigger the special mode.
Luckily it's only a handful and the relatively simple scheme doesn't seem like
such a bad choice.

But still, something needs to be done.
By default, the plover software will use the first valid code it finds.
Given that the codes are found in different dictionaries, in theory, the user
could just put either one of the dictionaries on top of the list.
This would then allow to set the priority on either words or commands.
However, this will also result in unexpected behavior for the affected steno
codes in the majority of cases.

Imagine you want expect to type *echt* and you trigger some shortcut in whatever
program you happen to be using instead.
But the same goes the other way round:
Imagine you don't want to do any text input and really want to reach `CTRL + E`.
The fact that this kind of situation is unlikely to arise doesn't help;
it just makes it much harder to figure out what's going on.

The solution is to leave the word generation intact and instead exclude all of
the above steno codes from the command generation.
That means none of the commands in the list above actually work.
Or put differently: the steno codes always produce the word and never the command.
In case you want to use one of the commands, you have two options:

First, you can add your own, specific steno code to reach the command.
Second, you can (sometimes) re-configure the software in question to rely on a
different shortcut.
12 changes: 7 additions & 5 deletions frontend/src/PageBlog.hs
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,13 @@ pageBlog getLoadedAndBuilt = elContainer mdo

widgetHold_ elWaitingForCMS $ evContent <&> \lsPandoc ->
elClass "div" "my-prose" $ for_ lsPandoc \pandoc@(Pandoc meta _) -> do
el "h3" $ elPandocInlines $ docDate meta
el "div" do
elClass "span" "font-bold text-lg" $ elPandocInlines $ docDate meta
el "span" do
text " by "
elPandocInlines $ join $ docAuthors meta
el "br" blank
el "h1" $ elPandocInlines $ docTitle meta
el "p" do
text "by "
elPandocInlines $ join $ docAuthors meta
elPandoc defaultConfig pandoc
el "hr" blank
where
Expand All @@ -152,7 +154,7 @@ pageBlog getLoadedAndBuilt = elContainer mdo
elClass "span" "float-left font-serif" $ text "Palantype DE"
elClass "span" "float-right" $ text "Blog"
elClass "br" "clear-both" blank
elClass "div" "px-8" h
elClass "div" "p-8" h


elCMSMenu
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/StenoInput.hs
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ elCell CellContext{..} i colspan positional =
bPressed s = bool NotPressed IsPressed $ k `Set.member` s
mode setPressedKeys modes =
let
isNumberModeAnyActive = Set.fromList (fromIndex <$> [9, 11])
isNumberModeAnyActive = Set.fromList (fromIndex <$> [8, 10])
`Set.isSubsetOf` setPressedKeys
isCommandModeActive = Set.fromList (fromIndex <$> [8, 11])
`Set.isSubsetOf` setPressedKeys
Expand Down
Loading

0 comments on commit ba687a9

Please sign in to comment.