fix(ui): preview shortcut chords and wait for complete modifier input (#1810)

Keep physical modifier events out of the ordinary-key slot, preview held keys immediately, and confirm after release and a one-second settling interval. Preserve legacy control-channel modifier behavior while allowing explicit physical Control/Command input. Add regression coverage, a UI scenario, localized guidance and documentation.

Fixes #1809.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ealitt
2026-10-23 20:05:58 +00:00
committed by GitHub
parent bb155d446a
commit 6eaf723041
15 changed files with 672 additions and 31 deletions
+26
View File
@@ -2,6 +2,32 @@
Command shortcuts can be changed in File › Keyboard Shortcuts; these are the defaults.
Click a binding to record a new shortcut. A shortcut can contain Shift, Ctrl/Cmd and
Alt/Option modifiers plus exactly one other key. Hold the modifiers, then press the final
key; you can take your time assembling the modifiers before that key. The recorder also
allows modifiers to arrive after the ordinary key: it previews the chord and waits one
second after the last added modifier, and until all keys are released, before confirming.
For example, record Shift+Cmd+M for Sketch Mirror on macOS. Escape cancels recording without
changing the old binding. Pressing two different ordinary keys cancels the attempt.
The binding button shows modifiers immediately as you press them, even before adding the
ordinary key. Releasing a modifier before that key removes it from the preview. A status
line tells you to add a key, release all keys, or wait for confirmation; the proposed chord
stays visible during confirmation. Nothing is saved while the preview is still pending.
On macOS, the editor, Help list, toolbar hints, context menus and S search display Cmd and
Option. Existing settings retain SolidCraft's Ctrl/Cmd alias for the primary modifier;
Control and Command pressed together are recorded explicitly as Ctrl+Cmd. Conflicting
bindings still require confirmation, and built-in reserved shortcuts remain reserved.
Recording changes app settings, not the design file.
This follows the usual [modifier-before-key convention documented by Apple](https://support.apple.com/en-ie/102650)
and the [key-event and modifier-state model documented by W3C](https://www.w3.org/TR/uievents/#keys-modifiers).
The one-second grace period is SolidCraft's recording aid, not a standard-mandated delay;
using an already assigned shortcut has no added delay. Operating systems and browsers can
intercept reserved combinations before SolidCraft receives them. Choose a different chord
if that happens; recording is cancelled if the app loses focus.
| Key | Command | Key | Command |
|---|---|---|---|
| L | Line | E | Extrude |
+1 -1
View File
@@ -218,7 +218,7 @@ labels; `prefs:measure_axis_distances` identifies the checkbox.
| `ui.handles` | `prefix?` | the handles drawn last frame, `[{name, x, y}]`: toolbar buttons and drop-down items `toolbar:<command id>` (the button alone: `button:<command id>`; a drop-down row: `dropdown:<command id>`, highlighted `dropdown_hot:<command id>`, its pin `dropdown_pin:<command id>`; Customize Toolbar's check boxes `customize:<command id>`), ribbon tabs `tab:<name>` (MODEL, SURFACE, ASSEMBLE, INSERT, INSPECT, MANAGE, VIEW, SHEET METAL; contextual SKETCH; workspace RENDER), panel labels `panel:<tab>:<panel>` (also `ribbon:section:<TAB>:<SECTION>`), document overflow list `tab:overflow`, workspace column `ribbon:workspace`, command-search launcher `ribbon:search`, browser rows `row:<label>` and fold arrows `fold:<label>`, manipulator handles; signed-axis tips `axis_view:z`, `axis_view:-y`; optional cube facets `navigation_cube:top`, `navigation_cube:top_front_right`, controls `navigation_cube:control:home` (and other actions), plus signed-axis aliases for visible cube faces; Preferences navigator picker `prefs:navigator`, options `prefs:navigator:Signed axes` and `prefs:navigator:Cube`; in the Motion Study dialog, where the chart puts its first and last step `motion:chart_start` and `motion:chart_end`, the Check collisions button `motion:check` and each collision found `motion:collision:<n>` |
| `ui.editFeature` | `feature` (id or name) | what double-clicking a timeline item does: rolls back to it and opens its dialog filled in (sketches open in sketch mode) |
| `ui.scroll` | `x`, `y`, `delta?` | wheel zoom at the cursor |
| `ui.key` | `key` (egui key name, `Enter`, `Escape`…), `cmd?`, `shift?` | |
| `ui.key` | `key` (egui key name, `Enter`, `Escape`…), `cmd?`, `ctrl?`, `shift?`, `alt?`, `pressed?` | By default, press and release, then release modifiers. With `pressed: true` or `false`, send only that edge; modifiers remain as given. `cmd` retains the legacy primary-modifier alias unless `ctrl` is explicit: `cmd:true, ctrl:false` sends physical Command, and both true sends Control+Command. `ui.move` can change modifiers between edges. |
| `ui.text` | `text` | typed text |
| `ui.screenshot` | `path?` | PNG of the window (needs a presented frame: a minimised or fully covered window answers at once with `hidden: true` and an error; use `ui.render`) |
| `ui.render` | `path`, `width?`, `height?`, `grid?`, `axes?` | Render of the model with the current camera (no window needed), drawn on the app's GPU device with the viewport's pipelines (the reply's `renderer`: `gpu`, or `gpu-software` on a software adapter), in the window's theme (light or dark; `solidcraft-cli snapshot` keeps the light colours); cut by the section the viewport shows (`inspect.section`, an open Section Analysis dialog's preview, a sketch's Slice), with the cut face capped. The ground grid and the origin's axes are drawn as the window shows them (`ui.set` `showGrid` and `showOrigin`, `hiddenOrigin`); `grid` and `axes` (booleans) say otherwise for this render |