mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-19 17:58:10 +00:00
Shortcuts: a tool or command can have a hold shortcut that runs when its key is held
Edit › Keyboard Shortcuts gets a Hold Shortcuts checkbox, off by default, with a ? button that explains it. While it is off, the dialog has no Hold column and every key runs on its press as before. While it is on, the dialog shows a Hold column and the Hold Shortcut Delay (`keyHoldDelay`, 0.35 s, 0.2 to 1.0 s), and a letter, digit or punctuation key, alone or with Shift, can hold a tool or command. Held for the delay, the key runs its hold shortcut once and its repeats are ignored until it is let go; a quicker press runs what the key runs without one, at the release. Another key, or Cmd, Ctrl or Alt, ends the wait first; focus loss, a dialog, a text field, Presentation Mode or an input method composition ends it without running anything. A hold on a letter alone leaves the letter with Shift as it is, and a key the active tool uses itself (E with the Extend Path tool) does not wait. A tool key with a hold shortcut runs the hold instead of choosing its tool temporarily (`holdToolKeys`). Preferences › General › Options lists both settings too, with the delay dimmed while Hold Shortcuts is off. Hold shortcuts are stored apart from the shortcuts (`shortcut_holds`). `shortcuts.set` takes `hold`, `shortcuts.list` rows have `hold`, `shortcuts.conflicts` lists hold clashes, Export… writes `holds` and Import… reads it, and Export Text… adds a `Hold X` column while the checkbox is on. Reset to Defaults and the presets clear them. The new strings have rows in every catalog.
This commit is contained in:
+30
-2
@@ -6330,6 +6330,33 @@ page describes saving the list from the Keyboard Shortcuts dialog as a text file
|
||||
{"name":"run_command","arguments":{"command":"shortcuts.exportText","params":{"path":"/Users/me/Shortcuts.txt"}}}
|
||||
```
|
||||
|
||||
A tool or command can also have a hold shortcut: a key that types a character (a letter, a digit or a punctuation
|
||||
key), alone or with Shift. Space and the backtick key cannot be hold shortcuts, and neither can a key with Cmd, Ctrl or
|
||||
Alt. Hold shortcuts act only while the preference `holdShortcuts` is on; it is off by default, and Edit › Keyboard
|
||||
Shortcuts shows it as the Hold Shortcuts checkbox, with a ? button that explains it. While it is off, the dialog shows
|
||||
no Hold column and every key runs on its press. While it is on, the dialog shows a Hold column and the Hold Shortcut
|
||||
Delay (`keyHoldDelay`, 0.2 to 1.0 s, 0.35 s by default; VectorCraft's own values). Preferences › General › Options
|
||||
lists both settings too, with Hold Shortcut Delay dimmed while Hold Shortcuts is off. A key with a hold shortcut then
|
||||
waits when it goes down: held for the delay, it runs its hold shortcut once and its repeats are ignored until it is let
|
||||
go; let go sooner, it runs what the key runs without a hold shortcut, at the release. Another key pressed while one
|
||||
waits, or Cmd, Ctrl or Alt pressed then, ends the wait first, so keys act in the order they went down. The window losing
|
||||
the keyboard, a dialog, a text field, Presentation Mode or an input method composition ends the wait and runs nothing.
|
||||
Keys without a hold shortcut run on their press as before, and so does a letter with Shift when only the letter alone
|
||||
has a hold shortcut, or a key the active tool uses itself (E with the Extend Path tool).
|
||||
|
||||
`shortcuts.set {id, hold}` sets a hold shortcut, and `hold: ""` or `null` removes it; `hold` alone leaves the entry's
|
||||
shortcut as it is, and a key that another entry already holds is refused unless `force` is true. Hold shortcuts are
|
||||
kept apart from shortcuts: Use Default, Clear and `shortcut: null` leave them, and `overridden` in `shortcuts.list` is
|
||||
about the shortcut only. `shortcuts.list` rows give the hold shortcut as `hold`, `shortcuts.conflicts` lists a key two
|
||||
entries hold as `"Hold X"`, and Reset to Defaults and a preset remove every hold shortcut. `shortcuts.export` writes
|
||||
them as a `holds` object (entry id to key) when there are any, and `shortcuts.import` reads it; a file without `holds`
|
||||
has none, and a `holds` value that is not a usable hold shortcut fails the import, which then changes nothing.
|
||||
`shortcuts.exportText` adds a third `Hold X` column to a row with a hold shortcut while `holdShortcuts` is on.
|
||||
|
||||
```json
|
||||
{"name":"run_command","arguments":{"command":"shortcuts.set","params":{"id":"paint.swap","hold":"X"}}}
|
||||
```
|
||||
|
||||
The desktop app adds its active artboard, the one the Artboards panel highlights, to the `object.align`,
|
||||
`object.distribute`, `object.distributeSpacing` and `select.allOnArtboard` calls it runs without `artboard`, as it does
|
||||
for `edit.pasteInPlace`, `edit.pasteInFront` and `edit.pasteInBack` (while the Artboard tool has several artboards
|
||||
@@ -6556,8 +6583,9 @@ interface and not the art: a zoom shows the art at the same size at every UI Sca
|
||||
preference `holdToolKeys` also needs the desktop app. It is on by default: a single-key tool shortcut held for 0.25 s
|
||||
or more, or held while its tool is used, chooses the tool until the key is let go and then returns to the tool active
|
||||
before, after any drag in progress; a quicker press chooses the tool for good. With it off, every press and every key
|
||||
repeat chooses the tool. The canvas preference `boundingBoxWhileMovingAndDrawing` (off by default) also needs the
|
||||
desktop app: on, with View › Show Bounding Box, the bounding box and its handles stay visible while a drag moves the
|
||||
repeat chooses the tool. While `holdShortcuts` is on, a tool key that also has a hold shortcut runs the hold shortcut
|
||||
when held, and a quick press chooses its tool for good. The canvas preference `boundingBoxWhileMovingAndDrawing` (off
|
||||
by default) also needs the desktop app: on, with View › Show Bounding Box, the bounding box and its handles stay visible while a drag moves the
|
||||
selection, and the Rectangle, Rounded Rectangle, Ellipse, Polygon and Star tools draw the box around the shape being
|
||||
drawn; off, the box hides during both, except that a Selection tool move with `realTimeDrawing` off still moves the
|
||||
box. `highlightAlternateGlyphs` (off by default: on, the canvas paints a pink cell behind glyphs OpenType features
|
||||
|
||||
@@ -1233,6 +1233,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
A Space+Shift drag rotates the view whatever the tool, as a Rotate View tool drag does, and Shift does not round the angle to 15°.
|
||||
While the Type tool edits text, Space types a space: held, it does not show the hand, pan or rotate the view, and Cmd+Space still zooms ([the help page](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) lists the Spacebar as the Hand tool when not in text-edit mode). Test: `canvas::tests::space_types_a_space_while_editing_text_and_does_not_pan`.
|
||||
As VectorCraft's own rule, a zoom marquee that Cmd+Space starts while the Type tool edits text keeps the marquee's Space rules after Cmd is let go: Space held since the press sizes it, Space pressed again moves it ([the help page](https://helpx.adobe.com/illustrator/using/viewing-artwork.html) describes holding the spacebar to move the marquee), and that Space types no space, nor does it during an animated zoom drag. With no zoom drag, Space types a space. Test: `canvas::tests::space_moves_a_text_edit_zoom_marquee_after_cmd_is_let_go`.
|
||||
- **Hold shortcuts:** Edit › Keyboard Shortcuts › Hold Shortcuts (off by default, `holdShortcuts`) shows a Hold column, where a tool or command gets a letter, digit or punctuation key, alone or with Shift. Holding that key for the Hold Shortcut Delay (`keyHoldDelay`, 0.35 s, 0.2 to 1.0 s) runs it once; a quicker press runs what the key runs without one, at the release (`shortcuts.set {id, hold}`). On a tool key, the hold shortcut takes precedence over Hold a Tool Shortcut to Use the Tool Temporarily. This is VectorCraft's own feature and its own delay. Tests `shortcuts::hold_keys::tests` and `shortcut_editor::tests::{a_hold_shortcut_is_kept_apart_from_the_shortcut, hold_shortcuts_refuse_keys_that_cannot_wait, the_hold_shortcuts_checkbox_shows_the_hold_column}`.
|
||||
- **Swatches panel clicks:** Ctrl/Cmd-clicking New Swatch makes a spot color, and Ctrl/Cmd+Shift-clicking it makes a global process color.
|
||||
- **Panel drag and drop:** art dragged off the canvas onto the Symbols panel becomes a symbol, art dragged onto the Swatches panel becomes a pattern swatch, and art dropped on the Brushes panel opens New Brush for that art; a symbol dragged onto the canvas places an instance where it is dropped, and a brush dragged onto a path is applied to it.
|
||||
New Brush asks for the type of brush first, as the [Brushes](https://web.archive.org/web/20241230205225/https://helpx.adobe.com/illustrator/using/brushes.html) page (archived copy) describes. The Brushes panel's New Brush button, its menu's New Brush… and art dropped on the panel open the New Brush dialog, where Scatter Brush, Art Brush and Pattern Brush need selected or dropped art. OK opens that type's Brush Options for the new brush, and their OK makes the brush with the name and options set; Cancel in either dialog adds no brush (`ui.newBrush`). The menu's New Calligraphic Brush, New Bristle Brush and New Art, Scatter and Pattern Brush from Selection items still make a brush at once.
|
||||
|
||||
Reference in New Issue
Block a user