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 903515c
Show file tree
Hide file tree
Showing 7 changed files with 550 additions and 541 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.
16 changes: 8 additions & 8 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ in
}) {};

servant-reflex = self.callCabal2nix "servant-reflex" ../servant-reflex {};
# servant-reflex = self.callCabal2nix "servant-reflex" (pkgs.fetchFromGitHub {
# owner = "rubenmoor";
# repo = "servant-reflex";
# rev = "06bd09d0777c658da5269840be60d6cb24a264e8";
# sha256 = "0s23q4cz93dw8wwz3n94l69qw5syvh37hj7bgdy5i0bb8b9g2617";
# }) {};
servant-reflex = self.callCabal2nix "servant-reflex" (pkgs.fetchFromGitHub {
owner = "rubenmoor";
repo = "servant-reflex";
rev = "ba50e31bc75cd3247c6b711aee998bbf4150f221";
sha256 = "1aq621li77xjh59w0za16971ilkdll5z8m124lh19hxi8jyqym4d";
}) {};

#servant-snap = self.callCabal2nix "servant-snap" ../servant-snap {};
servant-snap = self.callCabal2nix "servant-snap" (pkgs.fetchFromGitHub {
Expand All @@ -168,8 +168,8 @@ in
my-palantype = self.callCabal2nix "my-palantype" (pkgs.fetchFromGitHub {
owner = "rubenmoor";
repo = "my-palantype";
rev = "2afe58feed95771c2094fb797589286b1b84b522";
sha256 = "077cgzf7nd458sdy9aarp2nv1x5mfrb7wmzchqrz5yh4gp8s6l42";
rev = "a046de6e676173f520b10a430a4661aa5a042e90";
sha256 = "1sinsh4synsx9fa2hyfqx4pgqv8gqll499z3ya9hs7xzbca9hphj";
}) {};

bytestring-trie = self.callHackage "bytestring-trie" "0.2.7" {};
Expand Down
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 903515c

Please sign in to comment.