From d6681906bcced0f364e5029523ee9acf70a47918 Mon Sep 17 00:00:00 2001 From: Cl4ryty <61427823+Cl4ryty@users.noreply.github.com> Date: Sun, 18 Feb 2024 21:39:56 +0100 Subject: [PATCH] Fix #1585 Unplugging and then plugging in a USB device causes the operating system to reset the keymap. To avoid Plover sending key presses for keys it had previously configured but which are not mapped after the reset it is necessary to reset the keyboard emulator when resetting the machine after reconnecting so that Plover assumes the default keymap and any unmapped symbols will be added again --- plover/engine.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plover/engine.py b/plover/engine.py index cc83c5259..74a8d4b52 100644 --- a/plover/engine.py +++ b/plover/engine.py @@ -241,6 +241,8 @@ def _update(self, config_update=None, full=False, reset_machine=False): self._machine_params = machine_params update_keymap = True start_machine = True + # initialize keyboard emulation again to force update of keymap + self._keyboard_emulation.__init__() elif self._machine is not None: update_keymap = 'system_keymap' in config_update if update_keymap: