Package: plover-modal-dictionary
Modal Dictionaries for PloverModal Dictionariesare dictionaries that can switch two modes - activated and deactivated. Dictionary entries are hidden until they are activated by one of the configured activation strokes, after which they can be deactivated again under user-configured conditions.It is useful if you would like to have dictionaries that:Turn on with an activation stroke, then turn off when you stroke something outside of the dictionaryTurn on for one translation onlyExampleThis dictionary allows the user to enter navigation mode using one of the entries inentry, after which any stroke indictwould return an arrow key or navigation key. The dictionary will exit if the user strokes anything outside of these entries.StrokingSTPH-R/-R/-R/WORDwould, for instance, shift the text cursor 3 characters to the left, then write "word".{"exclude_entry":false,"exit_on_mismatch":true,"exit_on_match":false,"ignore_folding":true,"entry":{"STPH-R":"{#Left}{^}","STPH-P":"{#Up}{^}","STPH-B":"{#Down}{^}","STPH-G":"{#Right}{^}","STPH-RB":"{#Control_L(Left)}{^}","STPH-BG":"{#Control_L(Right)}{^}"},"dict":{"-R":"{#Left}{^}","-P":"{#Up}{^}","-B":"{#Down}{^}","-B/-G":"{#Down}{^}{#Right}{^}","-G":"{#Right}{^}","-RB":"{#Control_L(Left)}{^}","-BG":"{#Control_L(Right)}{^}"}}-B/-Gwas included to override the outline for "being" inmain.json.SetupFor the plugin to work properly, go into Configuration → Plugins and turn onmodal_update.UsageModal dictionaries have the.modalextension and follow the following format (using JSON syntax):{"exclude_entry":false,"exit_on_mismatch":true,"exit_on_match":false,"ignore_folding":true,"entry":{"S":"translation 1","T":"translation 2"},"dict":{"K":"translation 3","P":"translation 4"},"exit":{"W":"translation 5","H":"translation 6"}}Any of thetrue/falseoptions can be omitted. They are used like so:OptionDefaultUsageexclude_entryfalseWhether to exclude entry strokes when activated. If set totrue, entry strokes can still be used to enter activated mode as usual, but after activation, they are considered to be outside the dictionary.exit_on_mismatchtrueWhether to deactivate when a stroke is not found in the dictionary. Note that if you have a translation for a multistroke outline such as-F/-L, but none of its prefixes (such as-F) are defined, stroking-Fwill deactivate it and write "of" as usual, and stroking-Lwill delete the "of" and reactivate the dictionary again.exit_on_matchfalseWhether to deactivate after translating a single entry. This is useful if you want the dictionary to be activated for only one word/translation.ignore_foldingtrueWhether to ignore folding. Whenever a stroke such as-RGis sent to Plover and no translation can be found, Plover will split it into-R/-Gand search its dictionaries again. If set totrue, we will ignore such attempts and consider the input stroke as outside of the dictionary, even if-Rand-Gare defined.The dictionary contains 3 sub-dictionaries. They can be omitted, and the dictionary will treat them as empty:SubdictionaryUsageentryUsed to enter activated mode. These entries can be used when the dictionary is deactivated.dictMain dictionary entries, hidden until activated.exitUsed to exit activated mode, hidden until activated.These dictionaries can be defined using the usual JSON format, like so:"entry":{"S":"translation 1","T":"translation 2"}they can also just be references to other dictionary files with formats supported by your current Plover plugin setup:"entry":"some/other/dictionary.py"