feat: add hotkeys, allow active preset to be changed by keypress#196
Merged
feat: add hotkeys, allow active preset to be changed by keypress#196
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds configurable keyboard hotkeys to load presets from the GUI, including a dedicated Hotkey Settings dialog and persisted mappings in the app settings.
Changes:
- Persist hotkey mappings in
Settingsand expose a newhotkeymodule with (de)serialization + match logic. - Add a Hotkey Settings dialog + handler and wire new GUI messages for managing mappings.
- Subscribe to global keyboard events and trigger preset selection when a mapping matches.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/settings/mod.rs | Adds HotkeySettings to persisted Settings with serde defaults. |
| src/lib.rs | Exposes new hotkey module. |
| src/i18n/mod.rs | Adds EN/ZH-CN translation strings for the hotkey dialog. |
| src/hotkey/mod.rs | Implements hotkey mapping model, serialization helpers, and matching logic. |
| src/gui/messages/mod.rs | Adds hotkey-related messages and a KeyPressed message. |
| src/gui/messages/hotkey.rs | Defines HotkeyMessage enum for dialog interactions. |
| src/gui/handlers/mod.rs | Registers the new hotkey handler module. |
| src/gui/handlers/hotkey.rs | Introduces HotkeyHandler to manage dialog state + settings updates. |
| src/gui/components/dialogs/mod.rs | Registers the new hotkey dialog module. |
| src/gui/components/dialogs/hotkey.rs | Implements the Hotkey Settings dialog UI and learning flow. |
| src/gui/app.rs | Wires the handler/dialog into the app, adds keyboard subscription, triggers preset changes on hotkeys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #79