Plover "Keyboard Shortcut" Dictionary

887 views
Skip to first unread message

Ted Morin

unread,
Sep 10, 2014, 9:28:09 AM9/10/14
to plove...@googlegroups.com
Hello PloverSteno!

Intro:

I've seen complaints in the past about the lack of a "sticky modifier" function in Plover. The idea being that you could define a stroke for Shift, one for Control, then using these strokes write something like "Control/Shift/p" or any other stroke.

Well, today I'd like to announce my workaround!

It's a Python script that takes a list of modifiers (Control, Super, Alt, Shift, by default) and a list of hotkeys (alphanumeric, enter, backspace, delete, and arrow keys, by default) and then generates every *possible* combination in order to give you one-off hotkeys. The output is a dictionary that you load into Plover and you're ready to go.

Of course, I recommend a single stroke for something common like "Ctrl-v" for paste, but sometimes you just need a one-off "Control-alt-shift-Left arrow" and that's what this script aims to let you do.

As a little bonus, there's a definition in there that has 100 strokes in order to increase Plover's buffer length.

Usage:

If you don't like my default strokes, you can go into the script and change the "modifiers" or "hotkeys" lists in the main method.
But these are the defaults, as per the script:

- Alt/Option: TLA* (THRA*)
- Command: KM* (KPL*)
- Control: KL* (KHR*)
- Shift: SF* (STP*)

Otherwise all the letters, numbers, return, and backspace are all Plover default.

Of note, if you want to just "press" the combination without a key, for example in Windows you can use "Ctrl+Shift" to change keyboard layouts, use the blank stroke:

- "SP*S"

I also had to add an entry for the delete key, which is just:

- DLAO*ET (TKHRAO*ET)

Download:

Download it from the GitHub repo
. "modifiers.json" is the dictionary with all my defaults, "makeShortcuts.py" is the Python script to run to make the dictionary.

Please, feedback is welcome. Also think of this as a workaround, not a permanent solution to the problem.

--
Ted

Drew Neil

unread,
Sep 10, 2014, 10:11:14 AM9/10/14
to plove...@googlegroups.com
Nice work Ted! I had been thinking of creating a similar script - now I don’t have to.

The generated modifiers.json contains over 8000 definitions. I wonder, will that have an affect on Plover’s performance or memory footprint?

If I want to press Alt-Shift-A, your modifiers.json dictionary gives me two options: THRA*/STP*/A* or STP*/THRA*/A*. I assume that the same is true for other two-modifier chords. And for three-modifier chords there must be six options, and even more for four modifier chords, right? 

I had imagined going about this in a different way. To fingerspell “a”, we can use “A*”, whereas for the capital “A” we use “A*P”. Another way of saying capital A is “shift-A”. So in a sense, “*P” stands for the shift key. Suppose that we used “*F” to stand for the control key, then we could use “A*F” to stand for “ctrl-a”, “S*F” for “ctrl-s”, and so on for the rest of the alphabet. Using this scheme, you could then combine modifier keys with letters of the alphabet: “A*FP” would map to “ctrl-shift-a”, and “S*FP” would map to “ctrl-shift-p”, etc. The problem with this approach is that it would be much more likely to conflict with existing definitions in Plover’s dictionary (for example, “A*FP” is already mapped to “avenue”). By contrast, your scheme has a low probability of conflicting with existing entries in Plover’s dictionary.

Cheers,
Drew



--
You received this message because you are subscribed to the Google Groups "Plover" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ploversteno...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Theodore Morin

unread,
Sep 10, 2014, 10:15:10 AM9/10/14
to plove...@googlegroups.com

Thanks Drew.

Because Plover uses a dictionary lookup scheme to retrieve the entries, 8000 isn't actually a lot, considering the 160,000 default plover entries. Yes there are redundant entries but I consider it a trade off at being more "foolproof". Some people think Ctrl Alt, some Alt Ctrl.

Windows key also doesn't work yet, but Hesky said he's got it on his mind.

You received this message because you are subscribed to a topic in the Google Groups "Plover" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ploversteno/3ruTSs-uHm0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ploversteno...@googlegroups.com.

Drew Neil

unread,
Sep 10, 2014, 10:39:57 AM9/10/14
to plove...@googlegroups.com
Oh right, 8000 seems like a drop in the ocean compared with the full dictionary!

Drew Neil

unread,
Nov 27, 2015, 10:46:43 AM11/27/15
to plove...@googlegroups.com
Ted,

Do you still use the modifiers.json dictionary? I noticed that you haven’t (yet) included it on http://www.openstenoproject.org/stenodict/ and wondered why it wasn’t there.

Drew

On Wed, Sep 10, 2014 at 2:28 PM, Ted Morin <mori...@gmail.com> wrote:

--
Reply all
Reply to author
Forward
0 new messages