fix(shortcuts): pass configured mode to KeyboardShortcutManager on startup (#305)

On app restart, the shortcut mode (toggle vs push-to-talk) was not being
passed to KeyboardShortcutManager during initialization in TrayIndicator.
The backend always defaulted to 'toggle' mode regardless of user config,
causing push-to-talk shortcuts to not bind correctly on startup.

Fixes #296
This commit is contained in:
Jatin K Malik
2026-03-14 12:19:00 -07:00
committed by GitHub
parent 2672d8bc3f
commit c7e56e4c82
+4 -3
View File
@@ -79,11 +79,12 @@ class TrayIndicator:
self.config_manager = ConfigManager() # Added: Initialize ConfigManager
self._syncing_autostart_menu = False
# Get configured shortcut from config
# Get configured shortcut and mode from config
shortcut = self.config_manager.get("shortcuts", "toggle_recognition", "ctrl+ctrl")
mode = self.config_manager.get("shortcuts", "mode", "toggle")
# Initialize keyboard shortcut manager with configured shortcut
self.shortcut_manager = KeyboardShortcutManager(shortcut=shortcut)
# Initialize keyboard shortcut manager with configured shortcut and mode
self.shortcut_manager = KeyboardShortcutManager(shortcut=shortcut, mode=mode)
# Ensure icon directory exists
os.makedirs(ICON_DIR, exist_ok=True)