Skip to content

Add keyboard shortcuts help overlay (press ?) - #15

Merged
nmndwivedi merged 3 commits into
quickdrawjs:mainfrom
Munan059:main
Sep 19, 2026
Merged

nmndwivedi merged 3 commits into
quickdrawjs:mainfrom
Munan059:main

Conversation

@Munan059

Copy link
Copy Markdown
Contributor

Pressing ? toggles a dismissable overlay listing the keyboard map from the README, styled to the current theme.

What changed

  • editor.js: _keyDown emits a help event on ? (Shift+/).
  • ui.js: adds the overlay, built inside the UI layer (.qd-ui) and toggled via editor.on('help', ...). Closes on Esc / ? / backdrop click / close button, and is torn down in destroy().
  • quickdraw.css: theme-styled .qd-help-* rules reusing the existing --qd-* tokens.

The overlay lives in the UI layer so hideUi hosts are unaffected.

Closes #3

@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

@Munan059 is attempting to deploy a commit to the naman's projects Team on Vercel.

A member of the Team first needs to authorize it.

@nmndwivedi nmndwivedi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in the React demo on top of current main: ? toggles the overlay, Esc / ? / backdrop / close button all dismiss it, it follows light and dark themes, and it's torn down in destroy(). Two small nits I'll tidy in a follow-up rather than block on: the new line in _keyDown is over-indented, and 'help' should be added to the EditorEvent union in the types. Thanks!

@nmndwivedi
nmndwivedi merged commit 0b88ce4 into quickdrawjs:main Sep 19, 2026
1 check failed
nmndwivedi added a commit that referenced this pull request Sep 19, 2026
Follow-up to #15: add 'help' to EditorEvent, fix the indentation of the
new _keyDown branch, list ? in the README key table, and cover the
overlay's open/close/destroy paths.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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.

Keyboard shortcut cheat-sheet overlay (press ?)

2 participants