Skip to content

feat: configurable open/popup shortcuts and window toggle - #10

Merged
noxygalaxy merged 7 commits into
MoonMonet:mainfrom
gmcky:feature/open-hotkey
Aug 4, 2026
Merged

feat: configurable open/popup shortcuts and window toggle#10
noxygalaxy merged 7 commits into
MoonMonet:mainfrom
gmcky:feature/open-hotkey

Conversation

@gmcky

@gmcky gmcky commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Adds user-configurable global shortcuts and a toggle behaviour for the
main window.

What changed

  • Global shortcut to open the main window, persisted, with an in-app
    recorder in Settings to rebind it.
  • The open shortcut now toggles: it hides the window when it is already
    visible and focused, and shows and focuses it otherwise, so one key
    both summons and dismisses.
  • The popup translate trigger is now configurable and persisted, with
    its own recorder. It was previously hardcoded to a double Ctrl+C.
    The rdev double-press mechanism and clipboard coupling are unchanged,
    an empty value disables the popup, and the default is platform-aware
    (Cmd+C on macOS, Ctrl+C elsewhere).
  • Opening the window (hotkey, tray, or the Open menu item) focuses the
    text input so typing can start right away. It is tied to the open
    action rather than window focus, so returning to the window by other
    means does not steal focus or clear a selection.

Notes

  • The popup deliberately reuses the real copy keypress: the trigger key
    copies the selection to the clipboard, then the popup reads it. So a
    non-copy combo still opens the popup but on stale clipboard content;
    the settings panel shows a hint about this.
  • Only double-press is offered, not single. A single global press would
    fire the popup on every keystroke of that combo, since the listener
    does not consume the key.
  • A future option could bind any key by synthesising a copy before
    reading the clipboard, at the cost of injected keystrokes and
    clipboard clobber.

Verification

  • Built and ran on Windows (tauri dev)
  • Open shortcut toggles the window (show/focus, hide when focused)
  • Rebound open and popup shortcuts via the recorder; values persist
    in settings.json and reload on start
  • macOS default (Cmd+C) and empty-disables popup not verified on
    macOS

gmcky added 5 commits August 4, 2026 20:11
Register a configurable global shortcut that shows and focuses the
main window, independent of the existing Ctrl+C double-press popup.
The accelerator is loaded from settings on startup and can be
re-registered at runtime through a set_open_hotkey command. Defaults
to Ctrl+Shift+T.
Add openHotkey to the store defaults, load merge, and save payload so
the chosen accelerator survives restarts.
Add a Shortcut section that records a modifier + key combo, applies it
via set_open_hotkey, and persists it. A clear button unsets it.
The open hotkey only ever showed and focused the window. Toggle it
instead: hide when it is already visible and focused, show otherwise,
so the same key opens and dismisses the window.
The popup translate trigger was hardcoded to a double Ctrl+C press.
Add a popupHotkey setting so it can be rebound from the settings
panel. The rdev double-press mechanism and clipboard coupling are
kept unchanged, and an empty value disables the popup. Stored in
settings.json and applied on startup like the open hotkey.
@gmcky
gmcky marked this pull request as ready for review August 4, 2026 17:33
@gmcky
gmcky force-pushed the feature/open-hotkey branch from 4cdd858 to 48888ae Compare August 4, 2026 17:42
Opening the main window through the hotkey, tray, or the Open menu item
now focuses the text input so typing can start right away. It is tied to
the open action rather than to window focus, so returning to the window
by other means does not steal focus or clear a selection.
@gmcky
gmcky force-pushed the feature/open-hotkey branch from 48888ae to 2e0e38c Compare August 4, 2026 17:50
If the component unmounts before listen() resolves, cleanup runs with
no unlisten yet and the listener leaks. Track mount state and drop the
listener as soon as it resolves when already unmounted.
@noxygalaxy

Copy link
Copy Markdown
Collaborator

Thank you! Can i push it? or you're fixing more things?

@gmcky

gmcky commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Yeah, it's ready on my side, nothing else is coming. Good to merge whenever you want.

@noxygalaxy
noxygalaxy merged commit c9e6ec4 into MoonMonet:main Aug 4, 2026
3 checks passed
@gmcky
gmcky deleted the feature/open-hotkey branch August 4, 2026 19:00
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.

2 participants