openstenoproject / plover

Open source stenotype engine
http://opensteno.org/plover
GNU General Public License v2.0
2.32k stars 281 forks source link

Disconnecting and reconnecting the machine causes some diacritic entries to stop working. #1585

Open aerickt opened 1 year ago

aerickt commented 1 year ago

Describe the bug

Disconnecting the steno machine (tested on Gemini PR and keyboard with a Multisteno) will cause letters with diacritics to not be outputted by Plover.

To Reproduce

Steps to reproduce the behaviour:

  1. Add the following entry:
    "A": "người",
  2. Writing A will output the translation as expected (người)
  3. Unplug the steno machine
  4. Plug the steno machine back in
  5. Press the "reconnect machine button"
  6. Writing A will output ngi

Additionally, trying to undo this stroke with * will still result in 6 characters being deleted.

It appears that this bug only affects previously written translation. For example, skipping step 2 in the above process won't result in the malformed translation in step 6. I'm using a Vietnamese dictionary and this also shows up there: writing words with diacritics will result in the above behaviour only if they had been written before the machine was reconnected.

Restarting Plover will fix this issue temporarily.

Operating system

user202729 commented 1 year ago

Looks like #1164 should fix it.

(my guess for what was going on: when you unplug and plug some USB device, the operating system resets the keymap, while Plover still thinks that the corresponding entries consist of the characters with diacritics that it had put in there and just reuse these slots, which obviously fails. For new entries Plover correctly "thinks" that the entries are not in the keymap, so it modifies the keymap before sending the character and the output is correct)