Skip to content

Shortcuts: chords with Shift and a punctuation key fire as typed - #282

Merged
bflatastic merged 1 commit into
storytold:mainfrom
theironchef:fix/shifted-punctuation-shortcuts
Oct 7, 2026
Merged

bflatastic merged 1 commit into
storytold:mainfrom
theironchef:fix/shifted-punctuation-shortcuts

Conversation

@theironchef

Copy link
Copy Markdown
Contributor

Fixes #280.

Problem: egui reports the character a key types. With Shift held on US-style layouts:

  • [, ] and / arrive as OpenCurlyBracket, CloseCurlyBracket and Questionmark;
  • ` arrives as the text ~.

shortcuts::consume matched the parsed chord exactly, with an allowance only for + (#83). The single-key path looked up the typed text, which doesn't normalize to Shift+~. So four defaults never fired from the keyboard: Bring to Front (Cmd+Shift+]), Send to Back (Cmd+Shift+[), Search Commands (Cmd+Shift+/, which the hint bar advertises) and the Curvature tool (Shift+~).

Change (crates/ui-egui/src/shortcuts.rs, shortcut_editor.rs)

  • consume also accepts the shifted character for a chord that holds Shift: [→{, ]→}, /→?, ;→: and \→|, next to the existing =→+.
  • Single-key tool and command shortcuts also look up Shift+<typed text>, after the existing lookups, so ~ typed with Shift finds Shift+~. Keys bound to the character itself, like + for Add Anchor Point, still win.
  • The Keyboard Shortcuts editor records such a chord as its key: Cmd+Shift+], not Cmd+Shift+}. That's the form the defaults use, so conflicts are reported.

Non-US layouts, where these characters sit on other keys, aren't addressed here.

Tests

  • New shortcuts::tests::shifted_punctuation_shortcuts_work_as_typed:
    • Cmd+Shift+} / { bring the selection to the front and send it to the back;
    • Cmd+Shift+? opens Search Commands;
    • the text ~ with Shift selects the Curvature tool;
    • the editor records Cmd+Shift+} as Cmd+Shift+] and Cmd+Shift+? as Cmd+Shift+/.
  • Without the aliases, the test fails ("Bring to Front": order unchanged).
  • cargo test -p vectorcraft-ui-egui: 555 passed.
  • cargo clippy -p vectorcraft-ui-egui --all-targets -- -D warnings (Rust 1.99): clean.
  • cargo fmt --all -- --check: clean.
  • Checked by hand in a release build on Windows 11 (US layout) with real keys:
    • Ctrl+Shift+] → "Bring to Front" and Ctrl+Shift+[ → "Send to Back" (History and stacking order);
    • Ctrl+Shift+/ opens the command palette;
    • Shift+` selects the Curvature tool.
    • Before the change, all four did nothing in the same build setup.

I didn't run the full cargo xtask ci (wasm step) here.

🤖 Generated with Claude Code

… typed

egui reports the character a key types, so Cmd+Shift+[ arrives as
Cmd+Shift+{ (], / likewise as }, ?) and Shift+` as the text ~, and these
default shortcuts never matched: Bring to Front, Send to Back, Search
Commands and the Curvature tool. Command chords now also take the
shifted character, single-key tool and command shortcuts also look up
Shift+<typed text>, and the Keyboard Shortcuts editor records such a
chord as its key (Cmd+Shift+], not Cmd+Shift+}), so conflicts show.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bflatastic
bflatastic force-pushed the fix/shifted-punctuation-shortcuts branch from ef2f558 to b6649a3 Compare October 7, 2026 06:30
@bflatastic
bflatastic merged commit c462057 into storytold:main Oct 7, 2026
@bflatastic

Copy link
Copy Markdown
Member

Thanks @theironchef, merged! I rebased it on main and added a note to the M14 row of the ROADMAP. I checked it live in the app: Cmd+Shift+} and Cmd+Shift+{ bring to front and send to back, Cmd+Shift+? opens Search Commands, and Shift+~ picks the Curvature tool. Keeping the original chord and only adding the shifted aliases means nothing changes for other layouts.

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.

Bug: Shortcuts with Shift + punctuation don't fire (Bring to Front, Send to Back, Search Commands, Curvature tool)

2 participants