Skip to content

feat(hotkey): configurable chat overlay hotkey - #187

Open
Shresht7 wants to merge 19 commits into
ggml-org:mainfrom
Shresht7:feat/configurable-hotkey
Open

Shresht7 wants to merge 19 commits into
ggml-org:mainfrom
Shresht7:feat/configurable-hotkey

Conversation

@Shresht7

Copy link
Copy Markdown

Introduces the ability for users to configure a custom global hotkey to launch the chat overlay. Alt+Space remains the default. Also allows the user to disable the chat overlay shortcut entirely, if desired.

In addition to personalization, this will help prevent shortcut conflicts with other applications.

Chat Overlay Shortcut Settings


Changes

  • Made chat overlay hotkey configurable
  • Updated the Settings UI to:
    • Capture hotkey input
    • Show the currently active hotkey
    • Restore to default (Alt+Space)
    • Enable/disable the chat-overlay shortcut outright
    • Show a hint that the user needs to "Save" for the changes to apply
  • Implemented logic to restore the previously valid hotkey in case of registration failure
  • Created a Hotkey helper class (Hotkey.cs)
  • Added some basic unit tests for the Hotkey helpers
  • Updated README and comments

Miscellaneous

  • Added .vs/ directory to the .gitignore.

Considerations

  • Shortcut capture does not prevent Windows or other applications from responding to a shortcut while it is being recorded.
  • The Settings UI capture and registration feedback can be improved.
  • Pressing the shortcut again while the chat overlay is open could dismiss it.

I'd welcome feedback on whether any of these should be addressed in this PR or followed up separately, if at all.


Related Issue

Closes #179

Defaults to the combination <kbd>Alt</kbd> + <kbd>Space</kbd> as before
Accept `modifiers` and `vKey` as parameters in `Register` to make the overlay hotkey registration configurable

Ensures any previously registered hotkeys are cleared before re-registering
Remove the redundant `Unregister()` from the `Register()` method

`Register` and `Unregister` now have a clean boundary and do one task.

The `if(_registered) return` check gates that path so it was no-op anyway

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Configurable Chat Overlay Shortcut

2 participants