Skip to content

Keys section: three global hotkeys, choosable hold key, one recorder for every key - #11

Merged
Feargin merged 2 commits into
mainfrom
hotkeys
Oct 25, 2026
Merged

Feargin merged 2 commits into
mainfrom
hotkeys

Conversation

@Feargin

@Feargin Feargin commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

Replaces #10, which GitHub closed when its base branch (onboarding, #9) was merged and deleted. Same commits, plus a small fix for the tour on resize.

What

Settings → Keys — one section for every key, all saved in settings.json.

Global hotkeys (work in any app):

Action Default
Show the canvas / switch mode Alt+`` (as before)
Drawing ⇄ click-through (only switches; does not show a hidden canvas) none
Show / hide the canvas none
  • A global hotkey needs a modifier and at most three keys.
  • One combination belongs to one global action: another action using it is refused with used.
  • If another program holds a combination, the previous one is kept (taken).
  • A combination saved earlier but not registered at launch is kept and marked in orange, with the reason on hover.
  • ↺ restores the main hotkey; ✕ removes an optional one.

Hold and double tap. The hold key (mouse to the windows below) is now a setting, like the double-tap key: Alt, Ctrl, Shift, ⌘ (macOS) or off. Both are hidden on Linux, where there is no key polling.

Canvas keys. Same as before, now with the shared recorder:

  • a global hotkey takes its combination away from canvas keys, with a note saying which action lost it;
  • a canvas key cannot get a global hotkey's combination, because the system would catch it first.

Reset all restores canvas keys, global hotkeys, the hold key and the tap key.

The cheat sheet and the tour show the chosen hold key and any optional global hotkeys that are set.

How

  • Rust:
    • hotkey.rs — Action (show, mode, hide) with a slot per action and set / init.
    • overlay.rs — toggle_mode, toggle_visible.
    • keys::Tap → keys::Modifier; poll(hold, tap).
    • Commands: set_global_hotkey, set_hold_key; get_settings returns globals.
  • JS:
    • key-recorder.js (shared record button and note).
    • globals-settings.js (global hotkeys and modifiers).
    • keys-settings.js (canvas keys).
    • core/keymap.js: toAccelerator, with tests.
  • 10 new strings in all 11 languages; the section title becomes "Keys"; the unused settings.hotkey label is removed.

Checked

  • npm run check, npm test (17), cargo fmt --check, cargo clippy --all-targets -D warnings, cargo test (17) — clean. npm start launches the app.
  • Browser harness with a mocked Rust side:
    • recording a global hotkey; used, taken and no-modifier refusals;
    • a global hotkey taking Ctrl+Shift+C from a canvas key, and a canvas key refused a global combination;
    • changing the hold key updates the cheat sheet;
    • persistence across reload; ✕ removal and Reset all;
    • macOS (⌘ ⌥ ⇧ ⌃, ⌘⌥M recorded by physical key) and Linux (modifiers hidden); the orange "taken" state.
  • Not checked: registering real OS-level shortcuts. A dev build would write to the developer's real settings.json, so please try the three global hotkeys on a built version.

🤖 Generated with Claude Code

Feargin and others added 2 commits October 25, 2026 10:52
…anvas keys

- Global hotkeys: the main one (show the canvas / switch mode, Alt+`)
  plus two optional ones without a key by default — drawing ⇄
  click-through, and show / hide the canvas. hotkey.rs keeps a slot per
  action; one combination belongs to one action ("used"), a combination
  another program holds keeps the old one ("taken"), and one saved but
  not registered at launch is shown in orange
- The hold key is a setting too (Alt, Ctrl, Shift, ⌘ on macOS, or off);
  keys::Tap becomes keys::Modifier, shared by hold and tap
- Settings → Keys: global hotkeys, hold and double tap, canvas keys, with
  the same click-and-press recording (key-recorder.js). Combos convert to
  Tauri accelerators in core (toAccelerator, tested): a global hotkey
  takes its combination away from canvas keys, and a canvas key cannot
  get a global hotkey's combination. Reset all covers everything
- Labels wrap instead of being cut off; the panel is a little wider
- Saved in settings.json: hotkeyMode, hotkeyHide, holdKey; broken values
  fall back to defaults

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resizing the window re-ran the whole step, restarting the card's
animation and taking focus; it now only moves the cut-out and the card.
isTourActive was never used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Feargin
Feargin merged commit 4a23c2c into main Oct 25, 2026
12 checks passed
@Feargin
Feargin deleted the hotkeys branch October 25, 2026 08:34
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.

1 participant