Skip to content

feat: Allows customizing keyboard shortcuts from the keyboard shortcuts modal - #3080

Open
Mytherin wants to merge 1 commit into
standardnotes:mainfrom
Mytherin:feat/customizable-keyboard-shortcuts
Open

Mytherin wants to merge 1 commit into
standardnotes:mainfrom
Mytherin:feat/customizable-keyboard-shortcuts

Conversation

@Mytherin

Copy link
Copy Markdown

This PR allows customizing keyboard shortcuts. The shortcuts can be configured through the existing "Keyboard shortcuts" modal. Clicking a shortcut records a new key combination. While recording, a cancel button and a "None" button (assign no shortcut) are shown. "Reset all to defaults" appears once any shortcut has been changed. Conflicts with other customized shortcuts are flagged.

  • Keyboard commands now have stable string ids, and KeyboardService supports named, prioritized layers of shortcut overrides on top of the defaults, so other sources (e.g. plugins) can add overrides later.
  • User overrides are stored in a new synced preference (keyboardShortcutOverrides), which KeyboardService reads from the preferences service and re-applies whenever preferences change.
  • Navigation keys (arrows, Tab, Escape) and Super formatting shortcuts stay fixed.
  • Shortcut labels in menus and tooltips update live via a new useKeyboardShortcut hook.
  • Fixes command handler disposal clearing onKeyDown twice instead of onKeyUp.

…ts modal

- Keyboard commands now have stable string ids, and KeyboardService supports named, prioritized layers of shortcut overrides on top of the defaults, so other sources (e.g. plugins) can add overrides later.
- User overrides are stored in a new synced preference (keyboardShortcutOverrides), which KeyboardService reads from the preferences service and re-applies whenever preferences change.
- In the keyboard shortcuts modal, clicking a shortcut records a new key combination. While recording, a cancel button and a "None" button (assign no shortcut) are shown. "Reset all to defaults" appears once any shortcut has been changed. Conflicts with other customized shortcuts are flagged.
- Navigation keys (arrows, Tab, Escape) and Super formatting shortcuts stay fixed.
- Shortcut labels in menus and tooltips update live via a new useKeyboardShortcut hook.
- Fixes command handler disposal clearing onKeyDown twice instead of onKeyUp.

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.

1 participant