Skip to content

Commit

Permalink
Merge pull request #24 from psethwick/add-controller-param
Browse files Browse the repository at this point in the history
Support focus-on-start on newer Plover versions
  • Loading branch information
psethwick authored May 29, 2021
2 parents 20000da + ddf27d6 commit 032d2dd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions plover_console_ui/console_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ def status_bar_text(engine) -> str:


class ConsoleEngine(StenoEngine, Thread):
def __init__(self, config, keyboard_emulation, layout: ConsoleLayout):
StenoEngine.__init__(self, config, keyboard_emulation)
def __init__(self, config, keyboard_emulation, layout: ConsoleLayout, controller=None):
if controller:
StenoEngine.__init__(self, config, controller, keyboard_emulation)
else:
StenoEngine.__init__(self, config, keyboard_emulation)

Thread.__init__(self)
self.name += "-engine"
self.hook_connect("focus", focus_toggle)
Expand Down
4 changes: 2 additions & 2 deletions plover_console_ui/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def config_saver(config: Config, output, update):
config.save(f)


def main(config: Config):
def main(config: Config, controller=None):
# this screws things up
# hax tho
log.remove_handler(__logger._print_handler)
Expand All @@ -42,7 +42,7 @@ def main(config: Config):
for option in console_ui_options:
config._OPTIONS[option.name] = option

engine = ConsoleEngine(config, KeyboardEmulation(), layout)
engine = ConsoleEngine(config, KeyboardEmulation(), layout, controller)

if not engine.load_config():
return 3
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = plover_console_ui
version = 1.1.3
version = 1.1.4
description = Text User Interface for Plover
long_description = file: README.rst
author = Seth Rider
Expand Down

0 comments on commit 032d2dd

Please sign in to comment.