Skip to content

Instantly share code, notes, and snippets.

@sachac
Created May 2, 2021 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sachac/3b352c2bdceaeef535ce848986f306f1 to your computer and use it in GitHub Desktop.
Save sachac/3b352c2bdceaeef535ce848986f306f1 to your computer and use it in GitHub Desktop.
Allow {PLOVER:ALWAYS:START}Stuff goes here{PLOVER:ALWAYS:END} dictionary entries.
--- /tmp/h6IFbe_engine.py 2021-05-01 20:07:49.946440192 -0400
+++ plover/engine.py 2021-05-01 20:07:21.054396634 -0400
@@ -95,6 +95,7 @@
def __init__(self, config, keyboard_emulation):
self._config = config
self._is_running = False
+ self._previous_state = self._is_running
self._queue = Queue()
self._lock = threading.RLock()
self._machine = None
@@ -332,6 +333,14 @@
elif command_name == 'toggle':
self._toggle_output()
return True
+ elif command_name == 'always':
+ if len(command_args) > 0 and command_args[0].lower() == 'end':
+ if not self._previous_state:
+ self._set_output(self._previous_state)
+ else:
+ self._previous_state = self._is_running
+ self._set_output(True)
+ return True
elif command_name == 'quit':
self.quit()
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment