mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-19 08:52:45 +01:00
combo: #7971
This commit is contained in:
commit
8cb2ab2a27
48 files changed
+2445
-88
No files matched your search
@@ -157,6 +157,8 @@ pub const PREF_SPECS: &[PrefSpec] = &[
|
||||
p!("scrubNumericFields", "General", "Options", "Scrub Numeric Fields by Dragging", bool),
|
||||
p!("trackpadRotateView", "General", "Options", "Trackpad Gesture to Rotate View", bool),
|
||||
p!("holdToolKeys", "General", "Options", "Hold a Tool Shortcut to Use the Tool Temporarily", bool),
|
||||
p!("holdShortcuts", "General", "Options", "Hold Shortcuts", bool),
|
||||
p!("keyHoldDelay", "General", "Options", "Hold Shortcut Delay", num(0.2, 1.0, "s")),
|
||||
p!("boundingBoxWhileMovingAndDrawing", "General", "Options", "Show Bounding Box While Moving and Drawing", bool),
|
||||
// Selection & Anchor Display
|
||||
p!("selectionTolerance", "Selection & Anchor Display", "Selection", "Tolerance", num(1.0, 8.0, "px")),
|
||||
|
||||
@@ -418,7 +418,7 @@ use history::history_budget_for;
|
||||
pub use history::{History, HistoryEntry, NamedStep, default_history_budget};
|
||||
pub(crate) use interaction::PreviewCopies;
|
||||
pub use interaction::{Interaction, LastTransform, UndoGroup, UndoScope};
|
||||
pub use prefs::{DrawMode, PluginBudget, Prefs};
|
||||
pub use prefs::{DrawMode, KEY_HOLD_DELAY, KEY_HOLD_DELAY_RANGE, PluginBudget, Prefs};
|
||||
pub use sanity::TOO_DEEP;
|
||||
pub(crate) use sanity::{deselect_hidden, is_guide_path};
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -97,6 +97,13 @@ pub struct Prefs {
|
||||
/// A single-key tool shortcut held down chooses its tool until the key is let go, and then the
|
||||
/// tool active before comes back; a quick press chooses the tool for good.
|
||||
pub hold_tool_keys: bool,
|
||||
/// Hold shortcuts act (Edit › Keyboard Shortcuts › Hold Shortcuts, off by default): a key with a
|
||||
/// hold shortcut runs it when held for [`Self::key_hold_delay`], and its own shortcut when let go
|
||||
/// sooner. Off, every key runs on its press and the dialog shows no Hold column.
|
||||
pub hold_shortcuts: bool,
|
||||
/// Seconds a key with a hold shortcut must stay down before the hold shortcut runs (Hold
|
||||
/// Shortcut Delay, 0.2 to 1.0). VectorCraft's own default, 0.35.
|
||||
pub key_hold_delay: f64,
|
||||
/// With View › Show Bounding Box on, the bounding box stays visible while a drag moves the
|
||||
/// selection, and the shape tools that show it draw it around the shape being drawn. Off (the
|
||||
/// default), it hides during a move and while a shape is drawn, except that a Selection tool
|
||||
@@ -420,6 +427,21 @@ pub struct Prefs {
|
||||
pub import_matches: Vec<cmd::importmatches::ImportMatch>,
|
||||
}
|
||||
|
||||
/// The default Hold Shortcut Delay, in seconds (VectorCraft's own value).
|
||||
pub const KEY_HOLD_DELAY: f64 = 0.35;
|
||||
/// The range of the Hold Shortcut Delay, in seconds.
|
||||
pub const KEY_HOLD_DELAY_RANGE: (f64, f64) = (0.2, 1.0);
|
||||
|
||||
impl Prefs {
|
||||
/// The Hold Shortcut Delay in seconds, inside its range. A restored settings file is not
|
||||
/// checked against the range, so a value outside it is brought inside, and one that is not a
|
||||
/// number gives the default.
|
||||
pub fn key_hold_delay(&self) -> f64 {
|
||||
let (min, max) = KEY_HOLD_DELAY_RANGE;
|
||||
if self.key_hold_delay.is_finite() { self.key_hold_delay.clamp(min, max) } else { KEY_HOLD_DELAY }
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Prefs {
|
||||
fn default() -> Self {
|
||||
let s = |v: &str| v.to_string();
|
||||
@@ -451,6 +473,8 @@ impl Default for Prefs {
|
||||
scrub_numeric_fields: true,
|
||||
trackpad_rotate_view: true,
|
||||
hold_tool_keys: true,
|
||||
hold_shortcuts: false,
|
||||
key_hold_delay: KEY_HOLD_DELAY,
|
||||
bounding_box_while_moving_and_drawing: false,
|
||||
paste_offset: 10.0,
|
||||
selection_tolerance: 3.0,
|
||||
|
||||
@@ -176,3 +176,24 @@ fn a_file_over_the_limit_is_refused_before_it_is_parsed() {
|
||||
assert!(s.execute("prefs.import", &json!({"path": missing.to_string_lossy()})).is_err());
|
||||
assert_eq!(s.prefs.to_json().to_string(), before);
|
||||
}
|
||||
|
||||
/// Hold Shortcuts is off by default. The Hold Shortcut Delay takes 0.2 to 1.0 s and refuses other
|
||||
/// values; a value from a settings file outside the range is brought inside it.
|
||||
#[test]
|
||||
fn hold_shortcut_preferences() {
|
||||
let mut s = Session::new();
|
||||
assert!(!s.prefs.hold_shortcuts);
|
||||
assert_eq!(s.prefs.key_hold_delay(), 0.35);
|
||||
for ok in [0.2, 1.0] {
|
||||
s.execute("prefs.set", &json!({"key": "keyHoldDelay", "value": ok})).unwrap();
|
||||
assert_eq!(s.prefs.key_hold_delay(), ok);
|
||||
}
|
||||
for bad in [0.1, 1.5] {
|
||||
assert!(is_bad_params(s.execute("prefs.set", &json!({"key": "keyHoldDelay", "value": bad}))), "{bad}");
|
||||
}
|
||||
s.execute("prefs.set", &json!({"key": "holdShortcuts", "value": true})).unwrap();
|
||||
assert!(s.prefs.hold_shortcuts);
|
||||
let restored: Prefs = serde_json::from_value(json!({"keyHoldDelay": 5.0})).unwrap();
|
||||
assert_eq!(restored.key_hold_delay(), 1.0);
|
||||
assert!(!restored.hold_shortcuts);
|
||||
}
|
||||
@@ -190,8 +190,13 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"Cmd+I",
|
||||
"{} open the Check Spelling dialog to walk through unrecognized words with suggestions, ignore, change and dictionary options",
|
||||
),
|
||||
("shortcuts.set", "Set Keyboard Shortcut", "", "{id: command id or tool:<id>, shortcut: \"Cmd+Shift+K\" | \"\" (none) | null (default), force?}"),
|
||||
("shortcuts.list", "List Keyboard Shortcuts", "", "{query?} → [{id, label, group, shortcut, default, overridden}]"),
|
||||
(
|
||||
"shortcuts.set",
|
||||
"Set Keyboard Shortcut",
|
||||
"",
|
||||
"{id: command id or tool:<id>, shortcut?: \"Cmd+Shift+K\" | \"\" (none) | null (default), hold?: a character key alone or with Shift (\"X\", \"Shift+X\", \".\") | \"\" | null (none), force?} → {id, shortcut, hold, removedFrom}; `hold` alone leaves the shortcut as it is; a command listed only with a shortcut takes a hold only with one and loses it with the shortcut; a hold shortcut acts while the holdShortcuts preference is on",
|
||||
),
|
||||
("shortcuts.list", "List Keyboard Shortcuts", "", "{query?} → [{id, label, group, shortcut, hold, default, overridden}]"),
|
||||
("shortcuts.conflicts", "Keyboard Shortcut Conflicts", "", "{} → [{shortcut, ids}]"),
|
||||
("shortcuts.reset", "Reset Keyboard Shortcuts", "", "{}"),
|
||||
(
|
||||
@@ -205,7 +210,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"shortcuts.exportText",
|
||||
"Export Keyboard Shortcuts as Text…",
|
||||
"",
|
||||
"{path?, format?: \"text\"|\"sheet\"|\"csv\" (default text), pageSize?: \"letter\"|\"a4\" (sheet only; default A4 when the current document prints on A4, else letter)} save the current set's tools and menu commands with their shortcuts (Keyboard Shortcuts › Export Text…). text: a UTF-8 text file: the set's name, then a Tools and a Menu Commands section in the dialog's order, one `name<TAB>shortcut` line per row, empty after the tab when it has none. sheet: a printable PDF on landscape pages that lists the rows with a shortcut, Tools and then a group per top-level menu, under a colored band per group, shortcut then name, in four columns. csv: a UTF-8 CSV file (RFC 4180 quoting, CRLF) with a `Group,Command,Shortcut` header and one record per row in the sheet's groups, in the UI language; a field that starts with = + - @ and has more after it starts with '. A `path` is written as given. Without it, pick a file: the desktop save dialog offers the three formats (text first) unless `format` names one, and the file type picked decides and gives the name its extension; with no dialog, writer or download, returns {text} (text, csv) or {pdf: base64} (sheet); a bad `format` or `pageSize` is an error",
|
||||
"{path?, format?: \"text\"|\"sheet\"|\"csv\" (default text), pageSize?: \"letter\"|\"a4\" (sheet only; default A4 when the current document prints on A4, else letter)} save the current set's tools and menu commands with their shortcuts (Keyboard Shortcuts › Export Text…). text: a UTF-8 text file: the set's name, then a Tools and a Menu Commands section in the dialog's order, one `name<TAB>shortcut` line per row, empty after the tab when it has none, and while the holdShortcuts preference is on a third `Hold <key>` column on a row with a hold shortcut. sheet: a printable PDF on landscape pages that lists the rows with a shortcut, Tools and then a group per top-level menu, under a colored band per group, shortcut then name, in four columns. csv: a UTF-8 CSV file (RFC 4180 quoting, CRLF) with a `Group,Command,Shortcut` header and one record per row in the sheet's groups, in the UI language; a field that starts with = + - @ and has more after it starts with '. A `path` is written as given. Without it, pick a file: the desktop save dialog offers the three formats (text first) unless `format` names one, and the file type picked decides and gives the name its extension; with no dialog, writer or download, returns {text} (text, csv) or {pdf: base64} (sheet); a bad `format` or `pageSize` is an error",
|
||||
),
|
||||
("shortcuts.import", "Import Keyboard Shortcuts…", "", "{path? | data?}"),
|
||||
(
|
||||
|
||||
@@ -198,6 +198,7 @@ impl VectorcraftApp {
|
||||
input_frames: vec![],
|
||||
shortcuts_frames: vec![],
|
||||
held_tool: Vec::new(),
|
||||
hold_keys: Default::default(),
|
||||
synthetic_injected: false,
|
||||
injected_events: vec![],
|
||||
injected_generation: InputGeneration::default(),
|
||||
|
||||
@@ -518,6 +518,10 @@ pub fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> {
|
||||
}
|
||||
if let Some(k) = app.ui.dialog.as_mut() {
|
||||
k.fields.insert("overrides".into(), crate::keymap::stored::to_value(&shortcut_editor::saved_overrides(km.overrides(), &ov)));
|
||||
// VectorCraft's defaults have no hold shortcuts; Add to the Current Shortcuts keeps them.
|
||||
if !current {
|
||||
k.fields.insert("holds".into(), json!({}));
|
||||
}
|
||||
k.fields.insert("set".into(), json!(set));
|
||||
k.fields.insert("__message".into(), json!(tl!("Imported. Press OK to keep the imported set.")));
|
||||
}
|
||||
|
||||
@@ -234,6 +234,24 @@ fn cancel_and_apply_go_back_to_keyboard_shortcuts() {
|
||||
assert_eq!((app.ui.shortcut_set.as_str(), app.ui.shortcut_overrides.len()), ("Acme Keys", 3));
|
||||
}
|
||||
|
||||
/// Started from VectorCraft's defaults, an import leaves no hold shortcut in the working set; added
|
||||
/// to the current shortcuts, it keeps them. OK keeps what the working set shows.
|
||||
#[test]
|
||||
fn an_import_from_the_defaults_clears_the_hold_shortcuts() {
|
||||
let mut app = app();
|
||||
earlier_answers(&mut app);
|
||||
for (start, kept) in [("defaults", json!({})), ("current", json!({"paint.swap": "X"}))] {
|
||||
app.ui.shortcut_holds = [("paint.swap".to_string(), "X".to_string())].into();
|
||||
shortcut_editor::open(&mut app);
|
||||
super::shortcut_import::open(&mut app, "/sets/Acme Keys.kys", SET.as_bytes()).unwrap();
|
||||
set(&mut app, "start", json!(start));
|
||||
confirm(&mut app).unwrap();
|
||||
assert_eq!(dialog(&app).fields["holds"], kept, "{start}");
|
||||
confirm(&mut app).unwrap();
|
||||
assert_eq!(json!(app.ui.shortcut_holds), kept, "{start}: OK keeps it");
|
||||
}
|
||||
}
|
||||
|
||||
/// A document's Missing Fonts dialog that Keyboard Shortcuts replaced waits while Cancel goes back
|
||||
/// from Import Shortcut Set to Keyboard Shortcuts, and opens again once Keyboard Shortcuts closes.
|
||||
#[test]
|
||||
|
||||
@@ -3085,6 +3085,8 @@ digits Malayalam Малаялам
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Колелцето на мишката с натиснат Cmd/Ctrl превърта платното настрани.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Влаченето настрани върху етикета на числово поле променя стойността на полето.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Жест за завъртане с два пръста върху тъчпад завърта изгледа на платното.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Задържането на клавиш изпълнява инструмента или командата от колоната „Задръжте“ в „Клавишни комбинации“; краткото натискане изпълнява обичайната му комбинация.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Колко секунди трябва да се задържи клавиш, преди вместо обичайната му комбинация да се изпълни комбинацията му със задържане.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Когато премествате котвени точки, всяка крива с една преместена крайна точка запазва формата си спрямо краищата си.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Задържането на клавишната комбинация на инструмент го избира, докато я пуснете, а след това отново се избира предишният инструмент.
|
||||
Shows the bounding box while you move the selection or draw a shape. Показва ограничителната рамка, докато премествате селекцията или рисувате форма.
|
||||
@@ -7656,6 +7658,16 @@ breakText Glyphs Глифи
|
||||
@msg A joint does not close by {gap} pt. Една връзка не се затваря с {gap} pt.
|
||||
@msg Two panels pass through each other. Два панела минават един през друг.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer трябва да е "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine"
|
||||
Tap Кратко натискане
|
||||
Clear Hold Изчистване на задържането
|
||||
Hold Shortcuts Комбинации със задържане
|
||||
Hold Shortcut Delay Забавяне на комбинациите със задържане
|
||||
How hold shortcuts work Как работят комбинациите със задържане
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Щракнете и натиснете клавиш, който да се задържа за това (Esc отменя). Задържането на клавиша изпълнява това; краткото натискане изпълнява собствената комбинация на клавиша.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Краткото натискане на клавиш изпълнява неговата комбинация. Задържането на клавиша за времето на забавяне изпълнява вместо това инструмента или командата от колоната му „Задръжте“. Комбинация със задържане е клавиш с буква, цифра или препинателен знак, самостоятелно или с Shift.
|
||||
@msg Hold {_1} is already used by {_2} Задържането на {_1} вече се използва от {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) комбинация със задържане е клавиш, който въвежда знак, самостоятелно или с Shift ({shown} съдържа Cmd, Ctrl или Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} не може да бъде комбинация със задържане: използвайте буква, цифра или препинателен знак
|
||||
Pressure Sensitive Чувствителни на натиск
|
||||
Flex Ribbon Гъвкава лента
|
||||
Pulse Stroke Пулсиращ щрих
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4552,6 +4552,8 @@ font-technology Variable Varijabilni
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Točkić miša uz pritisnut Cmd/Ctrl pomjera platno u stranu.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Prevlačenje u stranu po oznaci brojčanog polja mijenja vrijednost polja.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Pokret rotacije s dva prsta na dodirnoj podlozi rotira prikaz platna.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Držanje tipke pokreće alat ili naredbu iz njene kolone „Zadrži“ u Prečicama na tastaturi; kratki pritisak pokreće njenu uobičajenu prečicu.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Koliko sekundi tipka mora biti pritisnuta prije nego što se umjesto uobičajene prečice pokrene njena prečica zadržavanjem.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Kada pomjerate sidrene tačke, svaka kriva s jednim pomjerenim krajem zadržava svoj oblik u odnosu na svoje krajeve.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Držanje prečice alata bira taj alat dok je ne pustite, a zatim se ponovo bira prethodni alat.
|
||||
Shows the bounding box while you move the selection or draw a shape. Prikazuje granični okvir dok pomjerate odabir ili crtate oblik.
|
||||
@@ -7711,6 +7713,16 @@ shape Open Otvoren
|
||||
@msg A joint does not close by {gap} pt. Spoj se ne zatvara za {gap} pt.
|
||||
@msg Two panels pass through each other. Dva panela prolaze jedan kroz drugi.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer mora biti "singleLine", "everyLine", "standardSingleLine" ili "standardEveryLine"
|
||||
Tap Kratki pritisak
|
||||
Clear Hold Očisti zadržavanje
|
||||
Hold Shortcuts Prečice zadržavanjem
|
||||
Hold Shortcut Delay Kašnjenje prečica zadržavanjem
|
||||
How hold shortcuts work Kako rade prečice zadržavanjem
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Kliknite, zatim pritisnite tipku koju treba zadržati za ovo (Esc otkazuje). Zadržavanje tipke pokreće ovo; kratki pritisak pokreće vlastitu prečicu tipke.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Kratki pritisak tipke pokreće njenu prečicu. Zadržavanje tipke tokom kašnjenja umjesto toga pokreće alat ili naredbu iz njene kolone Zadrži. Prečica zadržavanjem je tipka sa slovom, cifrom ili interpunkcijskim znakom, sama ili sa Shift.
|
||||
@msg Hold {_1} is already used by {_2} Zadržavanje {_1} već koristi {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) prečica zadržavanjem je tipka koja upisuje znak, sama ili sa Shift ({shown} ima Cmd, Ctrl ili Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} ne može biti prečica zadržavanjem: koristite slovo, cifru ili interpunkcijsku tipku
|
||||
Pressure Sensitive Osjetljivo na pritisak
|
||||
Flex Ribbon Savijajuća traka
|
||||
Pulse Stroke Pulsirajući potez
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -3936,6 +3936,8 @@ digits Malayalam Malaiàlam
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. La roda del ratolí amb Cmd/Ctrl premut desplaça el llenç en horitzontal.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Arrossegar en horitzontal sobre l’etiqueta d’un camp numèric canvia el valor del camp.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Un gest de rotació amb dos dits al trackpad gira la vista del llenç.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Mantenir premuda una tecla executa l’eina o l’ordre de la seva columna Mantén a Dreceres de teclat; una pulsació breu executa la seva drecera habitual.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Quants segons cal mantenir premuda una tecla perquè s’executi la seva drecera de pulsació llarga en lloc de la drecera habitual.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Quan moveu punts d’ancoratge, cada corba amb un extrem desplaçat conserva la forma respecte dels seus extrems.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Mantenir premuda la drecera d’una eina la tria fins que la deixeu anar, i després es torna a triar l’eina anterior.
|
||||
Shows the bounding box while you move the selection or draw a shape. Mostra el quadre delimitador mentre moveu la selecció o dibuixeu una forma.
|
||||
@@ -8613,6 +8615,16 @@ breakText Glyphs Glifs
|
||||
@msg A joint does not close by {gap} pt. Una unió no es tanca per {gap} pt.
|
||||
@msg Two panels pass through each other. Dos panells es travessen l’un a l’altre.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer ha de ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine"
|
||||
Tap Pulsació breu
|
||||
Clear Hold Esborra la pulsació llarga
|
||||
Hold Shortcuts Dreceres de pulsació llarga
|
||||
Hold Shortcut Delay Retard de les dreceres de pulsació llarga
|
||||
How hold shortcuts work Com funcionen les dreceres de pulsació llarga
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Fes clic i prem una tecla per mantenir premuda per a això (Esc cancel·la). Mantenir premuda la tecla executa això; una pulsació breu executa la drecera pròpia de la tecla.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Una pulsació breu d’una tecla executa la seva drecera. Mantenir premuda la tecla durant el retard executa en canvi l’eina o l’ordre de la seva columna Mantén. Una drecera de pulsació llarga és una tecla de lletra, xifra o puntuació, sola o amb Shift.
|
||||
@msg Hold {_1} is already used by {_2} La pulsació llarga de {_1} ja la fa servir {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) una drecera de pulsació llarga és una tecla que escriu un caràcter, sola o amb Shift ({shown} té Cmd, Ctrl o Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} no pot ser una drecera de pulsació llarga: fes servir una lletra, una xifra o una tecla de puntuació
|
||||
@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first una línia o un altre traçat obert que no tanca cap àrea no aporta cap àrea a la forma composta; per incloure’l, apliqueu-hi primer Objecte › Traçat › Contorneja el traç
|
||||
Pressure Sensitive Sensible a la pressió
|
||||
Flex Ribbon Cinta flexible
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4663,6 +4663,8 @@ font-technology Variable Variabilní
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Kolečko myši s podrženou klávesou Cmd/Ctrl posouvá plátno do stran.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Tažení do stran po popisku číselného pole mění hodnotu pole.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Gesto otočení dvěma prsty na trackpadu otáčí zobrazení plátna.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Podržení klávesy spustí nástroj nebo příkaz ze sloupce Podržení v Klávesových zkratkách; krátký stisk spustí její obvyklou zkratku.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Jak dlouho v sekundách je nutné klávesu podržet, než se místo obvyklé zkratky spustí její zkratka podržením.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Když přesouváte kotvové body, každá křivka s jedním přesunutým koncem si zachová tvar vůči svým koncům.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Podržení zkratky nástroje vybere nástroj, dokud ji nepustíte, a pak se znovu vybere předchozí nástroj.
|
||||
Shows the bounding box while you move the selection or draw a shape. Zobrazí ohraničovací rámeček, když přesouváte výběr nebo kreslíte tvar.
|
||||
@@ -10378,6 +10380,16 @@ breakText Glyphs Glyfy
|
||||
No objects are selected. Nejsou vybrány žádné objekty.
|
||||
Open a document to mark its fold lines. Otevřete dokument, abyste označili jeho linie skladu.
|
||||
Remove Fold Line Role Odstranit typ linie
|
||||
Tap Krátký stisk
|
||||
Clear Hold Vymazat podržení
|
||||
Hold Shortcuts Zkratky podržením
|
||||
Hold Shortcut Delay Prodleva zkratek podržením
|
||||
How hold shortcuts work Jak fungují zkratky podržením
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klikněte a stiskněte klávesu, kterou pro toto podržíte (Esc zruší). Podržení klávesy spustí toto; krátký stisk spustí vlastní zkratku klávesy.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Krátký stisk klávesy spustí její zkratku. Podržení klávesy po dobu prodlevy místo toho spustí nástroj nebo příkaz z jejího sloupce Podržení. Zkratka podržením je klávesa s písmenem, číslicí nebo interpunkcí, samotná nebo se Shiftem.
|
||||
@msg Hold {_1} is already used by {_2} Podržení {_1} už používá {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) zkratka podržením je klávesa, která píše znak, samotná nebo se Shiftem ({shown} obsahuje Cmd, Ctrl nebo Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} nemůže být zkratkou podržením: použijte písmeno, číslici nebo interpunkční klávesu
|
||||
Check Zkontrolovat
|
||||
Check Fold Lines Zkontrolovat linie skladu
|
||||
@msg No cut lines are in the selection. Ve výběru nejsou žádné linie řezu.
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7082,6 +7082,8 @@ font-technology Variable Variable
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Musehjulet med Cmd/Ctrl holdt nede ruller lærredet sidelæns.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Når du trækker sidelæns på et talfelts etiket, ændres feltets værdi.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. En rotationsbevægelse med to fingre på en pegeplade roterer visningen af lærredet.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Når du holder en tast nede, køres værktøjet eller kommandoen i dens Hold-kolonne i Tastaturgenveje; et kort tryk kører dens sædvanlige genvej.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Hvor mange sekunder en tast skal holdes nede, før dens holdegenvej køres i stedet for dens sædvanlige genvej.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Når du flytter ankerpunkter, beholder hver kurve med ét flyttet endepunkt sin form i forhold til sine endepunkter.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Når du holder et værktøjs genvejstast nede, er værktøjet valgt, indtil du slipper, og derefter vælges det forrige værktøj igen.
|
||||
Shows the bounding box while you move the selection or draw a shape. Viser afgrænsningsboksen, mens du flytter markeringen eller tegner en form.
|
||||
@@ -10501,6 +10503,16 @@ breakText Glyphs Glyffer
|
||||
@msg A joint does not close by {gap} pt. En samling lukker ikke med {gap} pt.
|
||||
@msg Two panels pass through each other. To paneler går gennem hinanden.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer skal være "singleLine", "everyLine", "standardSingleLine" eller "standardEveryLine"
|
||||
Tap Kort tryk
|
||||
Clear Hold Ryd hold
|
||||
Hold Shortcuts Holdegenveje
|
||||
Hold Shortcut Delay Forsinkelse for holdegenveje
|
||||
How hold shortcuts work Sådan virker holdegenveje
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klik, og tryk derefter på en tast, der skal holdes nede for dette (Esc annullerer). Når tasten holdes nede, køres dette; et kort tryk kører tastens egen genvej.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Et kort tryk på en tast kører dens genvej. Når tasten holdes nede i forsinkelsens varighed, køres i stedet værktøjet eller kommandoen i dens Hold-kolonne. En holdegenvej er en bogstav-, ciffer- eller tegnsætningstast, alene eller med Shift.
|
||||
@msg Hold {_1} is already used by {_2} Hold {_1} bruges allerede af {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) en holdegenvej er en tast, der skriver et tegn, alene eller med Shift ({shown} har Cmd, Ctrl eller Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} kan ikke være en holdegenvej: brug et bogstav, et ciffer eller en tegnsætningstast
|
||||
@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first en linje eller anden åben kurve, der ikke omslutter noget område, tilføjer intet område til den sammensatte figur; anvend først Objekt › Kurve › Streg til kontur på den for at tage den med
|
||||
Pressure Sensitive Trykfølsom
|
||||
Flex Ribbon Fleksibelt bånd
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3157,6 +3157,8 @@ digits Malayalam Malayalam
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Mit gedrückter Befehls-/Strg-Taste scrollt das Mausrad die Arbeitsfläche seitwärts.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Seitliches Ziehen auf der Beschriftung eines Zahlenfelds ändert den Wert des Felds.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Eine Drehgeste mit zwei Fingern auf einem Trackpad dreht die Ansicht der Arbeitsfläche.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Halten Sie eine Taste, wird das Werkzeug oder der Befehl aus ihrer Spalte „Halten“ unter „Tastaturbefehle“ ausgeführt; ein kurzer Druck führt ihren üblichen Tastaturbefehl aus.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Wie viele Sekunden eine Taste gehalten werden muss, bevor statt ihres üblichen Tastaturbefehls ihr Halte-Tastaturbefehl ausgeführt wird.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Wenn Sie Ankerpunkte verschieben, behält jede Kurve mit einem verschobenen Ende ihre Form relativ zu ihren Enden.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Solange Sie das Tastaturkürzel eines Werkzeugs gedrückt halten, ist dieses Werkzeug gewählt; danach wird wieder das vorherige gewählt.
|
||||
Shows the bounding box while you move the selection or draw a shape. Zeigt den Begrenzungsrahmen an, während Sie die Auswahl verschieben oder eine Form zeichnen.
|
||||
@@ -9990,6 +9992,16 @@ breakText Glyphs Glyphen
|
||||
No objects are selected. Es sind keine Objekte ausgewählt.
|
||||
Open a document to mark its fold lines. Öffnen Sie ein Dokument, um seine Faltlinien festzulegen.
|
||||
Remove Fold Line Role Linienart entfernen
|
||||
Tap Kurz drücken
|
||||
Clear Hold Halten löschen
|
||||
Hold Shortcuts Halte-Tastaturbefehle
|
||||
Hold Shortcut Delay Verzögerung für Halte-Tastaturbefehle
|
||||
How hold shortcuts work So funktionieren Halte-Tastaturbefehle
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klicken Sie und drücken Sie dann eine Taste, die hierfür gehalten werden soll (Esc bricht ab). Halten der Taste führt dies aus; kurzes Drücken führt den eigenen Tastaturbefehl der Taste aus.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Kurzes Drücken einer Taste führt ihren Tastaturbefehl aus. Halten der Taste für die Dauer der Verzögerung führt stattdessen das Werkzeug oder den Befehl in ihrer Spalte „Halten“ aus. Ein Halte-Tastaturbefehl ist eine Buchstaben-, Ziffern- oder Satzzeichentaste, allein oder mit Shift.
|
||||
@msg Hold {_1} is already used by {_2} Halten {_1} wird bereits von {_2} verwendet
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) Ein Halte-Tastaturbefehl ist eine Taste, die ein Zeichen eingibt, allein oder mit Shift ({shown} enthält Cmd, Ctrl oder Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} kann kein Halte-Tastaturbefehl sein: Verwenden Sie einen Buchstaben, eine Ziffer oder eine Satzzeichentaste
|
||||
Check Prüfen
|
||||
Check Fold Lines Faltlinien prüfen
|
||||
@msg No cut lines are in the selection. Die Auswahl enthält keine Schnittlinien.
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4008,6 +4008,8 @@ digits Malayalam Μαλαγιάλαμ
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Ο τροχός του ποντικιού με πατημένο το Cmd/Ctrl κυλά τον καμβά οριζόντια.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Η μεταφορά προς τα πλάγια πάνω στην ετικέτα ενός αριθμητικού πεδίου αλλάζει την τιμή του πεδίου.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Μια κίνηση περιστροφής με δύο δάχτυλα σε επιφάνεια αφής περιστρέφει την προβολή του καμβά.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Το παρατεταμένο πάτημα ενός πλήκτρου εκτελεί το εργαλείο ή την εντολή της στήλης «Κρατήστε πατημένο» στις Συντομεύσεις πληκτρολογίου· ένα σύντομο πάτημα εκτελεί τη συνηθισμένη συντόμευσή του.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Πόσα δευτερόλεπτα πρέπει να μένει πατημένο ένα πλήκτρο πριν εκτελεστεί η συντόμευση παρατεταμένου πατήματος αντί για τη συνηθισμένη συντόμευσή του.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Όταν μετακινείτε σημεία αγκύρωσης, κάθε καμπύλη με ένα μετακινημένο άκρο διατηρεί το σχήμα της σε σχέση με τα άκρα της.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Όσο κρατάτε πατημένη τη συντόμευση ενός εργαλείου, το εργαλείο είναι επιλεγμένο, και μετά επιλέγεται ξανά το προηγούμενο εργαλείο.
|
||||
Shows the bounding box while you move the selection or draw a shape. Εμφανίζει το πλαίσιο οριοθέτησης όσο μετακινείτε την επιλογή ή σχεδιάζετε ένα σχήμα.
|
||||
@@ -8587,6 +8589,16 @@ breakText Glyphs Γλύφοι
|
||||
@msg A joint does not close by {gap} pt. Μια ένωση δεν κλείνει κατά {gap} pt.
|
||||
@msg Two panels pass through each other. Δύο πάνελ διαπερνούν το ένα το άλλο.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" το composer πρέπει να είναι "singleLine", "everyLine", "standardSingleLine" ή "standardEveryLine"
|
||||
Tap Σύντομο πάτημα
|
||||
Clear Hold Εκκαθάριση παρατεταμένου πατήματος
|
||||
Hold Shortcuts Συντομεύσεις παρατεταμένου πατήματος
|
||||
Hold Shortcut Delay Καθυστέρηση συντομεύσεων παρατεταμένου πατήματος
|
||||
How hold shortcuts work Πώς λειτουργούν οι συντομεύσεις παρατεταμένου πατήματος
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Κάντε κλικ και πατήστε ένα πλήκτρο που θα κρατάτε πατημένο για αυτό (Esc για ακύρωση). Το παρατεταμένο πάτημα του πλήκτρου εκτελεί αυτό. Ένα σύντομο πάτημα εκτελεί τη συντόμευση του ίδιου του πλήκτρου.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Ένα σύντομο πάτημα πλήκτρου εκτελεί τη συντόμευσή του. Αν κρατήσετε πατημένο το πλήκτρο για τον χρόνο καθυστέρησης, εκτελείται αντί γι’ αυτό το εργαλείο ή η εντολή της στήλης «Κρατήστε πατημένο». Μια συντόμευση παρατεταμένου πατήματος είναι ένα πλήκτρο γράμματος, ψηφίου ή σημείου στίξης, μόνο του ή με Shift.
|
||||
@msg Hold {_1} is already used by {_2} το παρατεταμένο πάτημα του {_1} χρησιμοποιείται ήδη από το {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) μια συντόμευση παρατεταμένου πατήματος είναι ένα πλήκτρο που πληκτρολογεί έναν χαρακτήρα, μόνο του ή με Shift (το {shown} έχει Cmd, Ctrl ή Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key το {shown} δεν μπορεί να είναι συντόμευση παρατεταμένου πατήματος: χρησιμοποιήστε γράμμα, ψηφίο ή πλήκτρο στίξης
|
||||
@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first μια γραμμή ή άλλη ανοιχτή διαδρομή που δεν περικλείει εμβαδόν δεν προσθέτει εμβαδόν στο σύνθετο σχήμα· για να τη συμπεριλάβετε, εφαρμόστε της πρώτα Αντικείμενο › Διαδρομή › Μετατροπή περιγράμματος σε διαδρομή
|
||||
Pressure Sensitive Ευαίσθητα στην πίεση
|
||||
Flex Ribbon Εύκαμπτη κορδέλα
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3194,6 +3194,8 @@ digits Malayalam Malayálam
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. La rueda del mouse con Cmd/Ctrl pulsado desplaza el lienzo en horizontal.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Arrastrar en horizontal sobre la etiqueta de un campo numérico cambia el valor del campo.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Un gesto de giro con dos dedos en un trackpad gira la vista del lienzo.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Mantener pulsada una tecla ejecuta la herramienta o el comando de su columna Mantener pulsado en Métodos abreviados de teclado; una pulsación breve ejecuta su método abreviado habitual.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Cuántos segundos hay que mantener pulsada una tecla para que se ejecute su método abreviado de pulsación larga en lugar del habitual.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Al mover puntos de ancla, cada curva con un extremo movido conserva su forma respecto a sus extremos.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Mantener pulsado el atajo de una herramienta la elige hasta que lo suelta, y después vuelve a elegirse la herramienta anterior.
|
||||
Shows the bounding box while you move the selection or draw a shape. Muestra el cuadro delimitador mientras mueve la selección o dibuja una forma.
|
||||
@@ -10334,6 +10336,16 @@ breakText Glyphs Glifos
|
||||
@msg A joint does not close by {gap} pt. Una unión no cierra por {gap} pt.
|
||||
@msg Two panels pass through each other. Dos paneles se atraviesan entre sí.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer debe ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine"
|
||||
Tap Pulsación breve
|
||||
Clear Hold Borrar pulsación larga
|
||||
Hold Shortcuts Métodos abreviados de pulsación larga
|
||||
Hold Shortcut Delay Retardo de pulsación larga
|
||||
How hold shortcuts work Cómo funcionan los métodos abreviados de pulsación larga
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Haz clic y presiona una tecla que mantener pulsada para esto (Esc cancela). Mantener pulsada la tecla ejecuta esto; una pulsación breve ejecuta el método abreviado propio de la tecla.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Una pulsación breve de una tecla ejecuta su método abreviado. Mantener pulsada la tecla durante el retardo ejecuta en su lugar la herramienta o el comando de su columna Mantener pulsado. Un método abreviado de pulsación larga es una tecla de letra, dígito o puntuación, sola o con Shift.
|
||||
@msg Hold {_1} is already used by {_2} La pulsación larga de {_1} ya la usa {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) un método abreviado de pulsación larga es una tecla que escribe un carácter, sola o con Shift ({shown} tiene Cmd, Ctrl o Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} no puede ser un método abreviado de pulsación larga: usa una letra, un dígito o una tecla de puntuación
|
||||
@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first una línea u otro trazado abierto que no encierra ningún área no aporta ningún área a la forma compuesta; para incluirlo, aplícale primero Objeto › Trazado › Contornear trazo
|
||||
Pressure Sensitive Sensible a la presión
|
||||
Flex Ribbon Cinta flexible
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4573,6 +4573,8 @@ font-technology Variable Muuttuvat
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Hiiren rulla vierittää piirtopintaa sivuttain, kun Cmd/Ctrl on painettuna.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Numerokentän nimiön vetäminen sivuttain muuttaa kentän arvoa.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Kahden sormen kiertoele kosketuslevyllä kiertää piirtopinnan näkymää.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Näppäimen pitäminen painettuna suorittaa työkalun tai komennon sen Pidä pohjassa -sarakkeesta Pikanäppäimissä; lyhyt painallus suorittaa sen tavallisen pikanäppäimen.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Kuinka monta sekuntia näppäintä on pidettävä painettuna, ennen kuin tavallisen pikanäppäimen sijaan suoritetaan sen pitkän painalluksen pikanäppäin.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Kun siirrät ankkuripisteitä, jokainen käyrä, jonka toinen pää siirtyy, säilyttää muotonsa suhteessa päihinsä.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Työkalun pikanäppäimen pitäminen painettuna valitsee työkalun, kunnes päästät irti, ja sitten edellinen työkalu valitaan uudelleen.
|
||||
Shows the bounding box while you move the selection or draw a shape. Näyttää rajausruudun, kun siirrät valintaa tai piirrät muotoa.
|
||||
@@ -8670,6 +8672,16 @@ breakText Glyphs Merkit
|
||||
@msg A joint does not close by {gap} pt. Liitos ei sulkeudu, rako {gap} pt.
|
||||
@msg Two panels pass through each other. Kaksi paneelia kulkee toistensa läpi.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer on oltava "singleLine", "everyLine", "standardSingleLine" tai "standardEveryLine"
|
||||
Tap Lyhyt painallus
|
||||
Clear Hold Tyhjennä pitkä painallus
|
||||
Hold Shortcuts Pitkän painalluksen pikanäppäimet
|
||||
Hold Shortcut Delay Pitkän painalluksen viive
|
||||
How hold shortcuts work Näin pitkän painalluksen pikanäppäimet toimivat
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Napsauta ja paina sitten näppäintä, jota pidetään pohjassa tätä varten (Esc peruuttaa). Näppäimen pitäminen pohjassa suorittaa tämän; lyhyt painallus suorittaa näppäimen oman pikanäppäimen.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Näppäimen lyhyt painallus suorittaa sen pikanäppäimen. Kun näppäintä pidetään pohjassa viiveen ajan, suoritetaan sen sijaan sen Pidä pohjassa -sarakkeen työkalu tai komento. Pitkän painalluksen pikanäppäin on kirjain-, numero- tai välimerkkinäppäin yksin tai Shiftin kanssa.
|
||||
@msg Hold {_1} is already used by {_2} Pitkä painallus {_1} on jo käytössä kohteella {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) pitkän painalluksen pikanäppäin on merkin kirjoittava näppäin yksin tai Shiftin kanssa ({shown} sisältää Cmd-, Ctrl- tai Alt-näppäimen)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} ei voi olla pitkän painalluksen pikanäppäin: käytä kirjainta, numeroa tai välimerkkinäppäintä
|
||||
@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first viiva tai muu avoin polku, joka ei rajaa aluetta, ei lisää yhdistelmämuotoon aluetta; jos haluat sisällyttää sen, käytä siihen ensin komentoa Objekti › Polku › Ääriviivaa viiva
|
||||
Pressure Sensitive Paineherkkä
|
||||
Flex Ribbon Joustava nauha
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -3182,6 +3182,8 @@ digits Malayalam Malayalam
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. La molette de la souris avec Cmd/Ctrl enfoncée fait défiler la zone de travail latéralement.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Faire glisser latéralement le libellé d’un champ numérique modifie la valeur du champ.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Un geste de rotation à deux doigts sur un pavé tactile fait pivoter la vue de la zone de travail.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Maintenir une touche exécute l’outil ou la commande de sa colonne Maintenir dans Raccourcis clavier. Un appui bref exécute son raccourci habituel.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Durée, en secondes, pendant laquelle une touche doit être maintenue pour que son raccourci de maintien s’exécute à la place de son raccourci habituel.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Quand vous déplacez des points d’ancrage, chaque courbe dont une extrémité bouge garde sa forme par rapport à ses extrémités.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Maintenir le raccourci d’un outil choisit cet outil jusqu’à ce que vous le relâchiez, puis l’outil précédent est de nouveau choisi.
|
||||
Shows the bounding box while you move the selection or draw a shape. Affiche le cadre de sélection pendant que vous déplacez la sélection ou dessinez une forme.
|
||||
@@ -10363,6 +10365,16 @@ breakText Glyphs Glyphes
|
||||
No objects are selected. Aucun objet n’est sélectionné.
|
||||
Open a document to mark its fold lines. Ouvrez un document pour marquer ses lignes de pliage.
|
||||
Remove Fold Line Role Supprimer le type de ligne
|
||||
Tap Appui bref
|
||||
Clear Hold Effacer le maintien
|
||||
Hold Shortcuts Raccourcis de maintien
|
||||
Hold Shortcut Delay Délai des raccourcis de maintien
|
||||
How hold shortcuts work Fonctionnement des raccourcis de maintien
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Cliquez, puis appuyez sur une touche à maintenir pour cet élément (Échap annule). Maintenir la touche exécute cet élément ; un appui bref exécute le raccourci propre à la touche.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Un appui bref sur une touche exécute son raccourci. Maintenir la touche pendant le délai exécute à la place l’outil ou la commande de sa colonne Maintenir. Un raccourci de maintien est une touche de lettre, de chiffre ou de ponctuation, seule ou avec Maj.
|
||||
@msg Hold {_1} is already used by {_2} Le maintien de {_1} est déjà utilisé par {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) un raccourci de maintien est une touche qui saisit un caractère, seule ou avec Maj ({shown} comporte Cmd, Ctrl ou Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} ne peut pas être un raccourci de maintien : utilisez une lettre, un chiffre ou une touche de ponctuation
|
||||
Check Vérifier
|
||||
Check Fold Lines Vérifier les lignes de pliage
|
||||
@msg No cut lines are in the selection. La sélection ne contient aucune ligne de découpe.
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3241,6 +3241,8 @@
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Cmd/Ctrl દબાવી રાખીને માઉસ વ્હીલ ફેરવવાથી કેનવાસ બાજુમાં સ્ક્રોલ થાય છે.
|
||||
Dragging sideways on a numeric field's label changes the field's value. સંખ્યાત્મક ફીલ્ડના લેબલ પર બાજુમાં ખેંચવાથી ફીલ્ડનું મૂલ્ય બદલાય છે.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. ટ્રેકપેડ પર બે આંગળીથી ફેરવવાનો હાવભાવ કેનવાસનું દૃશ્ય ફેરવે છે.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. કી દબાવી રાખવાથી કીબોર્ડ શૉર્ટકટમાં તેની હોલ્ડ કૉલમનું ટૂલ અથવા કમાન્ડ ચાલે છે; ટૂંકું દબાણ તેનો સામાન્ય શોર્ટકટ ચલાવે છે.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. કીનો હોલ્ડ શોર્ટકટ તેના સામાન્ય શોર્ટકટને બદલે ચાલે તે પહેલાં કીને કેટલી સેકન્ડ દબાવી રાખવી પડે.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. જ્યારે તમે એન્કર પોઇન્ટ ખસેડો છો, ત્યારે એક ખસેલા છેડાવાળો દરેક વળાંક તેના છેડાઓની સાપેક્ષે પોતાનો આકાર જાળવે છે.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. ટૂલની શોર્ટકટ કી દબાવી રાખવાથી છોડો ત્યાં સુધી તે ટૂલ પસંદ રહે છે, પછી અગાઉનું ટૂલ ફરી પસંદ થાય છે.
|
||||
Shows the bounding box while you move the selection or draw a shape. તમે પસંદગી ખસેડો કે આકાર દોરો ત્યારે બાઉન્ડિંગ બોક્સ બતાવે છે.
|
||||
@@ -5414,6 +5416,16 @@ swatch [Registration] [રજિસ્ટ્રેશન]
|
||||
Standard Single-line Composer સ્ટાન્ડર્ડ સિંગલ-લાઇન કમ્પોઝર
|
||||
Standard Every-line Composer સ્ટાન્ડર્ડ એવરી-લાઇન કમ્પોઝર
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer આમાંથી એક હોવું જોઈએ: "singleLine", "everyLine", "standardSingleLine" અથવા "standardEveryLine"
|
||||
Tap ટૂંકું દબાણ
|
||||
Clear Hold હોલ્ડ સાફ કરો
|
||||
Hold Shortcuts હોલ્ડ શોર્ટકટ
|
||||
Hold Shortcut Delay હોલ્ડ શોર્ટકટ વિલંબ
|
||||
How hold shortcuts work હોલ્ડ શોર્ટકટ કેવી રીતે કામ કરે છે
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. ક્લિક કરો, પછી આ માટે દબાવી રાખવાની કી દબાવો (Esc રદ કરે છે). કી દબાવી રાખવાથી આ ચાલે છે; ટૂંકું દબાણ કીનો પોતાનો શોર્ટકટ ચલાવે છે.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. કીને ટૂંકું દબાવવાથી તેનો શોર્ટકટ ચાલે છે. વિલંબ જેટલો સમય કી દબાવી રાખવાથી તેના બદલે તેની હોલ્ડ કૉલમમાંનું ટૂલ અથવા આદેશ ચાલે છે. હોલ્ડ શોર્ટકટ એ અક્ષર, અંક અથવા વિરામચિહ્નની કી છે, એકલી અથવા Shift સાથે.
|
||||
@msg Hold {_1} is already used by {_2} હોલ્ડ {_1} પહેલેથી {_2} વાપરે છે
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) હોલ્ડ શોર્ટકટ એ અક્ષર લખતી કી છે, એકલી અથવા Shift સાથે ({shown} માં Cmd, Ctrl અથવા Alt છે)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} હોલ્ડ શોર્ટકટ ન હોઈ શકે: અક્ષર, અંક અથવા વિરામચિહ્નની કી વાપરો
|
||||
Pressure Sensitive દબાણ સંવેદનશીલ
|
||||
Flex Ribbon લવચીક પટ્ટી
|
||||
Pulse Stroke ધબકતો ઘસારો
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 72 and column 5.
|
@@ -4553,6 +4553,8 @@ antiAlias Sharp शार्प
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Cmd/Ctrl दबाकर माउस व्हील घुमाने से कैनवास बगल की ओर स्क्रॉल होता है।
|
||||
Dragging sideways on a numeric field's label changes the field's value. किसी संख्या वाले फ़ील्ड के लेबल पर बगल की ओर ड्रैग करने से फ़ील्ड का मान बदलता है।
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. ट्रैकपैड पर दो उंगलियों से घुमाने का जेस्चर कैनवास के व्यू को घुमाता है।
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. किसी कुंजी को दबाए रखने पर कीबोर्ड शॉर्टकट में उसके होल्ड कॉलम का टूल या कमांड चलता है; जल्दी दबाने पर उसका सामान्य शॉर्टकट चलता है।
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. किसी कुंजी को कितने सेकंड दबाए रखना होगा, ताकि उसके सामान्य शॉर्टकट के बजाय उसका होल्ड शॉर्टकट चले।
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. जब आप एंकर पॉइंट हिलाते हैं, तो एक हिले हुए सिरे वाला हर वक्र अपने सिरों के सापेक्ष अपना आकार बनाए रखता है।
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. किसी टूल की शॉर्टकट कुंजी दबाए रखने पर वह टूल छोड़ने तक चुना रहता है, फिर पिछला टूल दोबारा चुना जाता है।
|
||||
Shows the bounding box while you move the selection or draw a shape. सिलेक्शन खिसकाते या आकार ड्रॉ करते समय बाउंडिंग बॉक्स दिखाता है।
|
||||
@@ -9984,6 +9986,16 @@ theme Appearance अपीयरेंस
|
||||
No objects are selected. कोई ऑब्जेक्ट सिलेक्ट नहीं है।
|
||||
Open a document to mark its fold lines. फ़ोल्ड लाइनें मार्क करने के लिए कोई डॉक्यूमेंट ओपन करें।
|
||||
Remove Fold Line Role लाइन प्रकार हटाएँ
|
||||
Tap जल्दी दबाना
|
||||
Clear Hold होल्ड साफ़ करें
|
||||
Hold Shortcuts होल्ड शॉर्टकट
|
||||
Hold Shortcut Delay होल्ड शॉर्टकट विलंब
|
||||
How hold shortcuts work होल्ड शॉर्टकट कैसे काम करते हैं
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. क्लिक करें, फिर इसके लिए दबाए रखने वाली कुंजी दबाएँ (Esc रद्द)। कुंजी दबाए रखने पर यह चलता है; जल्दी से दबाने पर कुंजी का अपना शॉर्टकट चलता है।
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. किसी कुंजी को जल्दी से दबाने पर उसका शॉर्टकट चलता है। कुंजी को विलंब जितनी देर दबाए रखने पर इसके बजाय उसके होल्ड कॉलम का टूल या कमांड चलता है। होल्ड शॉर्टकट कोई अक्षर, अंक या विराम चिह्न वाली कुंजी होती है, अकेले या Shift के साथ।
|
||||
@msg Hold {_1} is already used by {_2} होल्ड {_1} का उपयोग पहले से ही {_2} द्वारा किया जाता है
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) होल्ड शॉर्टकट ऐसी कुंजी होती है जो अकेले या Shift के साथ कोई कैरेक्टर टाइप करती है ({shown} में Cmd, Ctrl या Alt है)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} होल्ड शॉर्टकट नहीं हो सकता: कोई अक्षर, अंक या विराम चिह्न वाली कुंजी उपयोग करें
|
||||
Check चेक करें
|
||||
Check Fold Lines फ़ोल्ड लाइनें चेक करें
|
||||
@msg No cut lines are in the selection. सिलेक्शन में कोई कट लाइन नहीं है।
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3775,6 +3775,8 @@ mark-style Japanese Japán
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Az egérgörgő lenyomott Cmd/Ctrl billentyűvel oldalirányban görgeti a vásznat.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Egy számmező címkéjén oldalirányban húzva módosul a mező értéke.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Az érintőpadon végzett kétujjas forgató kézmozdulat elforgatja a vászon nézetét.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Egy billentyű nyomva tartása a Billentyűparancsok Nyomva tartás oszlopában lévő eszközt vagy parancsot futtatja; egy rövid lenyomás a szokásos billentyűparancsát futtatja.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Hány másodpercig kell nyomva tartani egy billentyűt, hogy a szokásos billentyűparancsa helyett a nyomva tartásos billentyűparancsa fusson.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Horgonypontok mozgatásakor minden olyan görbe, amelynek egyik vége elmozdul, megtartja az alakját a végeihez képest.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Egy eszköz billentyűparancsát lenyomva tartva az eszköz a felengedésig ki van választva, utána ismét az előző eszköz lesz kiválasztva.
|
||||
Shows the bounding box while you move the selection or draw a shape. Megjeleníti a befoglaló keretet, miközben a kijelölést mozgatja vagy alakzatot rajzol.
|
||||
@@ -10366,6 +10368,16 @@ breakText Glyphs Glifák
|
||||
No objects are selected. Nincs kijelölt objektum.
|
||||
Open a document to mark its fold lines. Nyiss meg egy dokumentumot a hajtásvonalai megjelöléséhez.
|
||||
Remove Fold Line Role Vonaltípus eltávolítása
|
||||
Tap Rövid lenyomás
|
||||
Clear Hold Nyomva tartás törlése
|
||||
Hold Shortcuts Nyomva tartásos billentyűparancsok
|
||||
Hold Shortcut Delay Nyomva tartás késleltetése
|
||||
How hold shortcuts work Így működnek a nyomva tartásos billentyűparancsok
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Kattints, majd nyomd le a billentyűt, amelyet ehhez nyomva kell tartani (Esc: mégse). A billentyű nyomva tartása ezt futtatja; a rövid lenyomás a billentyű saját billentyűparancsát futtatja.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Egy billentyű rövid lenyomása a billentyűparancsát futtatja. Ha a késleltetés idejéig nyomva tartod, helyette a Nyomva tartás oszlopában lévő eszköz vagy parancs fut. Nyomva tartásos billentyűparancs lehet egy betű-, szám- vagy írásjelbillentyű, önmagában vagy Shifttel.
|
||||
@msg Hold {_1} is already used by {_2} már foglalt: nyomva tartás {_1} (használja: {_2})
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) a nyomva tartásos billentyűparancs egy karaktert beíró billentyű, önmagában vagy Shifttel ({shown} Cmd, Ctrl vagy Alt billentyűt tartalmaz)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} nem lehet nyomva tartásos billentyűparancs: használj betű-, szám- vagy írásjelbillentyűt
|
||||
Check Ellenőrzés
|
||||
Check Fold Lines Hajtásvonalak ellenőrzése
|
||||
@msg No cut lines are in the selection. A kijelölésben nincs vágóvonal.
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4295,6 +4295,8 @@ font-technology Variable Variabel
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Roda mouse dengan Cmd/Ctrl ditahan menggulir kanvas ke samping.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Menyeret ke samping pada label bidang angka mengubah nilai bidang itu.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Gerakan putar dua jari pada trackpad memutar tampilan kanvas.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Menahan tombol menjalankan alat atau perintah di kolom Tahan pada Pintasan papan ketik; tekanan singkat menjalankan pintasan biasanya.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Berapa detik tombol harus ditahan sebelum pintasan tahannya berjalan sebagai ganti pintasan biasanya.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Saat Anda memindahkan titik jangkar, setiap kurva dengan satu ujung yang dipindahkan mempertahankan bentuknya terhadap ujung-ujungnya.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Menahan tombol pintasan alat memilih alat itu sampai Anda melepasnya, lalu alat sebelumnya dipilih lagi.
|
||||
Shows the bounding box while you move the selection or draw a shape. Menampilkan kotak pembatas saat Anda memindahkan seleksi atau menggambar bentuk.
|
||||
@@ -7673,6 +7675,16 @@ breakText Glyphs Glif
|
||||
@msg A joint does not close by {gap} pt. Sebuah sambungan tidak menutup sejauh {gap} pt.
|
||||
@msg Two panels pass through each other. Dua panel saling menembus.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer harus "singleLine", "everyLine", "standardSingleLine", atau "standardEveryLine"
|
||||
Tap Tekan singkat
|
||||
Clear Hold Hapus Tahan
|
||||
Hold Shortcuts Pintasan tahan
|
||||
Hold Shortcut Delay Jeda pintasan tahan
|
||||
How hold shortcuts work Cara kerja pintasan tahan
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klik, lalu tekan tombol yang ditahan untuk ini (Esc membatalkan). Menahan tombol menjalankan ini; tekan singkat menjalankan pintasan milik tombol itu sendiri.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Tekan singkat sebuah tombol menjalankan pintasannya. Menahan tombol selama jeda menjalankan alat atau perintah di kolom Tahan sebagai gantinya. Pintasan tahan adalah tombol huruf, angka, atau tanda baca, sendiri atau dengan Shift.
|
||||
@msg Hold {_1} is already used by {_2} Tahan {_1} sudah digunakan oleh {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) pintasan tahan adalah tombol yang mengetik karakter, sendiri atau dengan Shift ({shown} memakai Cmd, Ctrl, atau Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} tidak bisa menjadi pintasan tahan: gunakan huruf, angka, atau tombol tanda baca
|
||||
Pressure Sensitive Peka Tekanan
|
||||
Flex Ribbon Pita Lentur
|
||||
Pulse Stroke Goresan Berdenyut
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2558 and column 5.
|
@@ -3242,6 +3242,8 @@ digits Malayalam Malayalam
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. La rotellina del mouse con Cmd/Ctrl premuto scorre l'area di lavoro in orizzontale.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Trascinare in orizzontale sull'etichetta di un campo numerico ne cambia il valore.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Un gesto di rotazione con due dita sul trackpad ruota la vista dell'area di lavoro.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Tenere premuto un tasto esegue lo strumento o il comando della sua colonna Tieni premuto in Scelte rapide da tastiera; una pressione breve esegue la sua scorciatoia abituale.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Per quanti secondi va tenuto premuto un tasto prima che venga eseguita la sua scorciatoia a pressione prolungata invece di quella abituale.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Quando sposti i punti di ancoraggio, ogni curva con un’estremità spostata mantiene la propria forma rispetto alle sue estremità.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Tenere premuta la scorciatoia di uno strumento lo sceglie finché non la rilasci, poi viene scelto di nuovo lo strumento precedente.
|
||||
Shows the bounding box while you move the selection or draw a shape. Mostra il riquadro di delimitazione mentre sposti la selezione o disegni una forma.
|
||||
@@ -10023,6 +10025,16 @@ breakText Glyphs Glifi
|
||||
No objects are selected. Nessun oggetto selezionato.
|
||||
Open a document to mark its fold lines. Apri un documento per segnarne le linee di piega.
|
||||
Remove Fold Line Role Rimuovi tipo di linea
|
||||
Tap Pressione breve
|
||||
Clear Hold Cancella pressione prolungata
|
||||
Hold Shortcuts Scorciatoie a pressione prolungata
|
||||
Hold Shortcut Delay Ritardo delle scorciatoie a pressione prolungata
|
||||
How hold shortcuts work Come funzionano le scorciatoie a pressione prolungata
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Fai clic, poi premi un tasto da tenere premuto per questo (Esc annulla). Tenere premuto il tasto esegue questo; una pressione breve esegue la scorciatoia del tasto stesso.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Una pressione breve di un tasto esegue la sua scorciatoia. Tenere premuto il tasto per la durata del ritardo esegue invece lo strumento o il comando della sua colonna Tieni premuto. Una scorciatoia a pressione prolungata è un tasto di lettera, cifra o punteggiatura, da solo o con Shift.
|
||||
@msg Hold {_1} is already used by {_2} La pressione prolungata di {_1} è già usata da {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) una scorciatoia a pressione prolungata è un tasto che digita un carattere, da solo o con Shift ({shown} ha Cmd, Ctrl o Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} non può essere una scorciatoia a pressione prolungata: usa una lettera, una cifra o un tasto di punteggiatura
|
||||
Check Verifica
|
||||
Check Fold Lines Verifica linee di piega
|
||||
@msg No cut lines are in the selection. Nella selezione non ci sono linee di taglio.
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3226,6 +3226,8 @@ mark-style Japanese 日本式
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Cmd/Ctrl キーを押しながらマウスホイールを回すとカンバスを横にスクロールします。
|
||||
Dragging sideways on a numeric field's label changes the field's value. 数値フィールドのラベルを横にドラッグすると、フィールドの値が変わります。
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. トラックパッドで 2 本指の回転ジェスチャーをすると、カンバスの表示が回転します。
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. キーを長押しすると、キーボードショートカットの長押し列にあるツールまたはコマンドを実行します。短く押すと通常のショートカットを実行します。
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. 通常のショートカットの代わりに長押しショートカットを実行するまで、キーを押し続ける秒数です。
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. アンカーポイントを移動すると、一方の端が移動した各曲線は、両端に対する形状を保ちます。
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. ツールのショートカットキーを押している間はそのツールを選び、離すと前のツールに戻ります。
|
||||
Shows the bounding box while you move the selection or draw a shape. 選択範囲の移動中や図形の描画中にバウンディングボックスを表示します。
|
||||
@@ -10087,6 +10089,16 @@ breakText Glyphs 字形
|
||||
No objects are selected. オブジェクトが選択されていません。
|
||||
Open a document to mark its fold lines. ドキュメントを開くと折り線を設定できます。
|
||||
Remove Fold Line Role 線種を解除
|
||||
Tap 短押し
|
||||
Clear Hold 長押しを消去
|
||||
Hold Shortcuts 長押しショートカット
|
||||
Hold Shortcut Delay 長押しショートカットの遅延
|
||||
How hold shortcuts work 長押しショートカットのしくみ
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. クリックしてから、これに使う長押しのキーを押します (Esc でキャンセル)。キーを長押しするとこれを実行し、短く押すとキー自体のショートカットを実行します。
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. キーを短く押すと、そのショートカットを実行します。遅延の時間だけキーを押し続けると、代わりに長押し列のツールまたはコマンドを実行します。長押しショートカットには、文字、数字、句読点のキーを単独で、または Shift と組み合わせて使用できます。
|
||||
@msg Hold {_1} is already used by {_2} 長押し {_1} はすでに {_2} で使用されています
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) 長押しショートカットは、文字を入力するキーを単独で、または Shift と組み合わせたものです ({shown} には Cmd、Ctrl、Alt のいずれかが含まれています)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} は長押しショートカットにできません: 文字、数字、句読点のいずれかのキーを使用してください
|
||||
Check チェック
|
||||
Check Fold Lines 折り線をチェック
|
||||
@msg No cut lines are in the selection. 選択範囲にカット線がありません。
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -6370,6 +6370,8 @@ font-technology Variable ცვლადი
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. დაჭერილი Cmd/Ctrl-ით მაუსის ბორბალი ტილოს გვერდულად გადაახვევს.
|
||||
Dragging sideways on a numeric field's label changes the field's value. რიცხვითი ველის წარწერაზე გვერდულად გადათრევა ველის მნიშვნელობას ცვლის.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. ტრეკპადზე ორი თითით მობრუნების ჟესტი ტილოს ხედს აბრუნებს.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. კლავიშის ხანგრძლივი დაჭერა უშვებს ხელსაწყოს ან ბრძანებას კლავიატურის მალსახმობების დაჭერის სვეტიდან; მოკლე დაჭერა უშვებს მის ჩვეულ მალსახმობს.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. რამდენი წამი უნდა იყოს კლავიში დაჭერილი, სანამ ჩვეული მალსახმობის ნაცვლად მისი ხანგრძლივი დაჭერის მალსახმობი გაეშვება.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. როცა ღუზის წერტილებს გადაადგილებთ, ყოველი მრუდი, რომლის ერთი ბოლოც გადაადგილდა, ინარჩუნებს ფორმას თავის ბოლოებთან მიმართებით.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. სანამ ხელსაწყოს მალსახმობ კლავიშს დაჭერილს გიჭირავთ, ეს ხელსაწყოა არჩეული; კლავიშის აშვების შემდეგ ისევ წინა ხელსაწყო აირჩევა.
|
||||
Shows the bounding box while you move the selection or draw a shape. აჩვენებს შემომსაზღვრელ ჩარჩოს, სანამ მონიშნულს გადაადგილებთ ან ფიგურას ხატავთ.
|
||||
@@ -10749,6 +10751,16 @@ font-script Japanese იაპონური
|
||||
@msg A joint does not close by {gap} pt. შეერთება არ იხურება {gap} pt-ით.
|
||||
@msg Two panels pass through each other. ორი პანელი ერთმანეთში გადის.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer უნდა იყოს "singleLine", "everyLine", "standardSingleLine" ან "standardEveryLine"
|
||||
Tap მოკლე დაჭერა
|
||||
Clear Hold ხანგრძლივი დაჭერის გასუფთავება
|
||||
Hold Shortcuts ხანგრძლივი დაჭერის მალსახმობები
|
||||
Hold Shortcut Delay ხანგრძლივი დაჭერის დაყოვნება
|
||||
How hold shortcuts work როგორ მუშაობს ხანგრძლივი დაჭერის მალსახმობები
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. დაწკაპეთ, შემდეგ დააჭირეთ კლავიშს, რომელიც ამისთვის უნდა დაიჭიროთ (Esc აუქმებს). კლავიშის ხანგრძლივი დაჭერა ამას უშვებს; მოკლე დაჭერა კლავიშის საკუთარ მალსახმობს უშვებს.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. კლავიშის მოკლე დაჭერა მის მალსახმობს უშვებს. თუ კლავიშს დაყოვნების ხანგრძლივობით დაიჭერთ, ამის ნაცვლად გაეშვება მისი „დაჭერა“ სვეტის ხელსაწყო ან ბრძანება. ხანგრძლივი დაჭერის მალსახმობი არის ასოს, ციფრის ან სასვენი ნიშნის კლავიში, ცალკე ან Shift კლავიშთან ერთად.
|
||||
@msg Hold {_1} is already used by {_2} ხანგრძლივი დაჭერა {_1} უკვე გამოიყენება ამისთვის: {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) ხანგრძლივი დაჭერის მალსახმობი არის კლავიში, რომელიც სიმბოლოს წერს, ცალკე ან Shift კლავიშთან ერთად ({shown} შეიცავს Cmd, Ctrl ან Alt კლავიშს)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} ვერ იქნება ხანგრძლივი დაჭერის მალსახმობი: გამოიყენეთ ასო, ციფრი ან სასვენი ნიშნის კლავიში
|
||||
Pressure Sensitive წნევაზე მგრძნობიარე
|
||||
Flex Ribbon მოქნილი ლენტი
|
||||
Pulse Stroke პულსირებადი მონასმი
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3215,6 +3215,8 @@ mark-style Japanese 일본식
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Cmd/Ctrl 키를 누른 채 마우스 휠을 돌리면 캔버스가 가로로 스크롤됩니다.
|
||||
Dragging sideways on a numeric field's label changes the field's value. 숫자 필드의 레이블을 옆으로 드래그하면 필드 값이 바뀝니다.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. 트랙패드에서 두 손가락으로 회전하는 동작을 하면 캔버스 보기가 회전합니다.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. 키를 누르고 있으면 키보드 단축키의 누르고 있기 열에 있는 도구나 명령이 실행되고, 짧게 누르면 평소 단축키가 실행됩니다.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. 평소 단축키 대신 길게 누르기 단축키가 실행되기 전까지 키를 누르고 있어야 하는 시간(초)입니다.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. 고정점을 이동하면 한쪽 끝이 이동한 각 곡선은 양 끝을 기준으로 모양을 유지합니다.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. 도구의 바로 가기 키를 누르고 있는 동안 그 도구가 선택되고, 키를 놓으면 이전 도구가 다시 선택됩니다.
|
||||
Shows the bounding box while you move the selection or draw a shape. 선택 영역을 이동하거나 모양을 그리는 동안 테두리 상자를 표시합니다.
|
||||
@@ -9986,6 +9988,16 @@ breakText Glyphs 글리프
|
||||
No objects are selected. 선택한 개체가 없습니다.
|
||||
Open a document to mark its fold lines. 접는 선을 지정하려면 문서를 여세요.
|
||||
Remove Fold Line Role 선 종류 제거
|
||||
Tap 짧게 누르기
|
||||
Clear Hold 길게 누르기 지우기
|
||||
Hold Shortcuts 길게 누르기 단축키
|
||||
Hold Shortcut Delay 길게 누르기 단축키 지연 시간
|
||||
How hold shortcuts work 길게 누르기 단축키 작동 방식
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. 클릭한 다음 이 항목에 길게 누를 키를 누르세요 (Esc로 취소). 키를 길게 누르면 이 항목이 실행되고, 짧게 누르면 키 자체의 단축키가 실행됩니다.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. 키를 짧게 누르면 해당 단축키가 실행됩니다. 지연 시간 동안 키를 누르고 있으면 대신 누르고 있기 열의 도구나 명령이 실행됩니다. 길게 누르기 단축키는 문자, 숫자 또는 문장 부호 키이며, 단독으로 또는 Shift와 함께 사용합니다.
|
||||
@msg Hold {_1} is already used by {_2} 길게 누르기 {_1}은(는) 이미 {_2}에서 사용 중입니다
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) 길게 누르기 단축키는 문자를 입력하는 키를 단독으로 또는 Shift와 함께 사용해야 합니다 ({shown}에 Cmd, Ctrl 또는 Alt가 있음)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown}은(는) 길게 누르기 단축키가 될 수 없습니다: 문자, 숫자 또는 문장 부호 키를 사용하세요
|
||||
Check 검사
|
||||
Check Fold Lines 접는 선 검사
|
||||
@msg No cut lines are in the selection. 선택 영역에 재단선이 없습니다.
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4955,6 +4955,8 @@ font-technology Variable Variabel
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Het muiswiel met Cmd/Ctrl ingedrukt schuift het canvas zijwaarts.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Zijwaarts slepen over het label van een numeriek veld wijzigt de waarde van het veld.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Een draaigebaar met twee vingers op een trackpad draait de weergave van het canvas.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Als u een toets vasthoudt, wordt het gereedschap of de opdracht uit de kolom Houd in Sneltoetsen uitgevoerd; kort drukken voert de gewone sneltoets uit.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Hoeveel seconden u een toets moet vasthouden voordat de vasthoudsneltoets wordt uitgevoerd in plaats van de gewone sneltoets.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Als u ankerpunten verplaatst, behoudt elke curve met één verplaatst uiteinde zijn vorm ten opzichte van zijn uiteinden.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Als u de sneltoets van een gereedschap ingedrukt houdt, is dat gereedschap gekozen tot u loslaat, en daarna wordt het vorige gereedschap weer gekozen.
|
||||
Shows the bounding box while you move the selection or draw a shape. Toont het begrenzingskader terwijl u de selectie verplaatst of een vorm tekent.
|
||||
@@ -10415,6 +10417,16 @@ breakText Glyphs Glyphs
|
||||
No objects are selected. Er zijn geen objecten geselecteerd.
|
||||
Open a document to mark its fold lines. Open een document om de vouwlijnen te markeren.
|
||||
Remove Fold Line Role Lijnsoort verwijderen
|
||||
Tap Kort drukken
|
||||
Clear Hold Vasthouden wissen
|
||||
Hold Shortcuts Vasthoudsneltoetsen
|
||||
Hold Shortcut Delay Vertraging vasthoudsneltoetsen
|
||||
How hold shortcuts work Zo werken vasthoudsneltoetsen
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klik en druk vervolgens een toets in die hiervoor wordt vastgehouden (Esc annuleert). De toets vasthouden voert dit uit; kort drukken voert de eigen sneltoets van de toets uit.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Kort drukken op een toets voert de sneltoets ervan uit. De toets vasthouden gedurende de vertraging voert in plaats daarvan het gereedschap of de opdracht in de kolom Houd uit. Een vasthoudsneltoets is een letter-, cijfer- of leestekentoets, alleen of met Shift.
|
||||
@msg Hold {_1} is already used by {_2} Vasthouden {_1} wordt al gebruikt door {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) een vasthoudsneltoets is een toets die een teken typt, alleen of met Shift ({shown} bevat Cmd, Ctrl of Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} kan geen vasthoudsneltoets zijn: gebruik een letter, een cijfer of een leestekentoets
|
||||
Check Controleren
|
||||
Check Fold Lines Vouwlijnen controleren
|
||||
@msg No cut lines are in the selection. De selectie bevat geen snijlijnen.
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4506,6 +4506,8 @@ font-technology Variable Zmienne
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Kółko myszy z wciśniętym Cmd/Ctrl przewija obszar roboczy w poziomie.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Przeciąganie w bok po etykiecie pola liczbowego zmienia wartość pola.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Gest obrotu dwoma palcami na gładziku obraca widok obszaru roboczego.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Przytrzymanie klawisza uruchamia narzędzie lub polecenie z jego kolumny Przytrzymaj w Skrótach klawiaturowych; krótkie naciśnięcie uruchamia jego zwykły skrót.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Ile sekund trzeba przytrzymać klawisz, zanim zamiast zwykłego skrótu zostanie uruchomiony jego skrót przytrzymania.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Podczas przesuwania punktów kontrolnych każda krzywa z jednym przesuniętym końcem zachowuje kształt względem swoich końców.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Przytrzymanie skrótu narzędzia wybiera je do momentu puszczenia klawisza, a potem ponownie wybierane jest poprzednie narzędzie.
|
||||
Shows the bounding box while you move the selection or draw a shape. Pokazuje obwiednię podczas przesuwania zaznaczenia lub rysowania kształtu.
|
||||
@@ -10241,6 +10243,16 @@ breakText Glyphs Glify
|
||||
No objects are selected. Nie zaznaczono żadnych obiektów.
|
||||
Open a document to mark its fold lines. Otwórz dokument, aby oznaczyć jego linie zgięcia.
|
||||
Remove Fold Line Role Usuń rodzaj linii
|
||||
Tap Krótkie naciśnięcie
|
||||
Clear Hold Wyczyść przytrzymanie
|
||||
Hold Shortcuts Skróty przytrzymania
|
||||
Hold Shortcut Delay Opóźnienie skrótów przytrzymania
|
||||
How hold shortcuts work Jak działają skróty przytrzymania
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Kliknij, a następnie naciśnij klawisz, który ma być przytrzymywany dla tego elementu (Esc anuluje). Przytrzymanie klawisza uruchamia ten element; krótkie naciśnięcie uruchamia własny skrót klawisza.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Krótkie naciśnięcie klawisza uruchamia jego skrót. Przytrzymanie klawisza przez czas opóźnienia uruchamia zamiast tego narzędzie lub polecenie z jego kolumny Przytrzymaj. Skrót przytrzymania to klawisz litery, cyfry lub znaku interpunkcyjnego, sam lub z Shift.
|
||||
@msg Hold {_1} is already used by {_2} Przytrzymanie {_1} jest już używane przez {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) skrót przytrzymania to klawisz wpisujący znak, sam lub z Shift ({shown} zawiera Cmd, Ctrl lub Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} nie może być skrótem przytrzymania: użyj litery, cyfry lub klawisza interpunkcyjnego
|
||||
Check Sprawdź
|
||||
Check Fold Lines Sprawdź linie zgięcia
|
||||
@msg No cut lines are in the selection. W zaznaczeniu nie ma linii cięcia.
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2679,6 +2679,8 @@ digits Malayalam Malaiala
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. A roda do mouse com Cmd/Ctrl pressionado rola a tela para os lados.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Arrastar para os lados sobre o rótulo de um campo numérico muda o valor do campo.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Um gesto de rotação com dois dedos no trackpad gira a visualização da tela.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Manter uma tecla pressionada executa a ferramenta ou o comando da coluna Manter pressionado em Atalhos de Teclado; um toque rápido executa o atalho habitual.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Quantos segundos uma tecla precisa ficar pressionada até que seu atalho de pressionamento longo seja executado no lugar do atalho habitual.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Ao mover pontos de ancoragem, cada curva com uma extremidade movida mantém sua forma em relação às extremidades.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Manter pressionado o atalho de uma ferramenta a escolhe até você soltar, e então a ferramenta anterior é escolhida de novo.
|
||||
Shows the bounding box while you move the selection or draw a shape. Mostra a caixa delimitadora enquanto você move a seleção ou desenha uma forma.
|
||||
@@ -10450,6 +10452,16 @@ swatch Yellow Green Verde-amarelado
|
||||
No objects are selected. Nenhum objeto selecionado.
|
||||
Open a document to mark its fold lines. Abra um documento para marcar suas linhas de dobra.
|
||||
Remove Fold Line Role Remover Tipo de Linha
|
||||
Tap Toque Rápido
|
||||
Clear Hold Limpar Pressionamento Longo
|
||||
Hold Shortcuts Atalhos de Pressionamento Longo
|
||||
Hold Shortcut Delay Atraso dos Atalhos de Pressionamento Longo
|
||||
How hold shortcuts work Como funcionam os atalhos de pressionamento longo
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Clique e depois pressione uma tecla para manter pressionada para isto (Esc cancela). Manter a tecla pressionada executa isto; um toque rápido executa o atalho da própria tecla.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Um toque rápido em uma tecla executa o atalho dela. Manter a tecla pressionada pelo tempo do atraso executa, em vez disso, a ferramenta ou o comando da coluna Manter pressionado. Um atalho de pressionamento longo é uma tecla de letra, número ou pontuação, sozinha ou com Shift.
|
||||
@msg Hold {_1} is already used by {_2} O pressionamento longo de {_1} já é usado por {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) um atalho de pressionamento longo é uma tecla que digita um caractere, sozinha ou com Shift ({shown} tem Cmd, Ctrl ou Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} não pode ser um atalho de pressionamento longo: use uma letra, um número ou uma tecla de pontuação
|
||||
Check Verificar
|
||||
Check Fold Lines Verificar Linhas de Dobra
|
||||
@msg No cut lines are in the selection. Não há linhas de corte na seleção.
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3224,6 +3224,8 @@ digits Malayalam Малаялам
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Колесо мыши с нажатой Cmd/Ctrl прокручивает холст по горизонтали.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Перетаскивание по подписи числового поля в сторону меняет значение поля.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Жест поворота двумя пальцами на трекпаде поворачивает вид холста.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Удержание клавиши запускает инструмент или команду из её столбца «Удерживать» в «Сочетаниях клавиш»; короткое нажатие запускает её обычное сочетание.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Сколько секунд нужно удерживать клавишу, прежде чем вместо её обычного сочетания сработает сочетание удержания.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. При перемещении опорных точек каждая кривая с одним перемещённым концом сохраняет форму относительно своих концов.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Пока вы удерживаете клавишу инструмента, он остаётся выбранным, а после отпускания снова выбирается предыдущий инструмент.
|
||||
Shows the bounding box while you move the selection or draw a shape. Показывает ограничивающую рамку, пока вы перемещаете выделение или рисуете фигуру.
|
||||
@@ -10496,6 +10498,16 @@ shape Open Открытый
|
||||
@msg Two panels pass through each other. Две панели проходят друг сквозь друга.
|
||||
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} пикселей — слишком большой размер для PSD (не более {MAX_SIDE} пикселей по стороне): уменьшите разрешение
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer должен быть "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine"
|
||||
Tap Короткое нажатие
|
||||
Clear Hold Очистить удержание
|
||||
Hold Shortcuts Клавиши удержания
|
||||
Hold Shortcut Delay Задержка клавиш удержания
|
||||
How hold shortcuts work Как работают клавиши удержания
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Щелкните, затем нажмите клавишу, которую нужно удерживать для этого (Esc отменяет). Удержание клавиши запускает это; короткое нажатие запускает собственное сочетание клавиши.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Короткое нажатие клавиши запускает ее сочетание. Удержание клавиши в течение задержки запускает вместо этого инструмент или команду из ее столбца «Удерживать». Клавиша удержания — это клавиша буквы, цифры или знака препинания, отдельно или с Shift.
|
||||
@msg Hold {_1} is already used by {_2} Удержание {_1} уже используется для {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) клавиша удержания — это клавиша, которая вводит символ, отдельно или с Shift ({shown} содержит Cmd, Ctrl или Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} не может быть клавишей удержания: используйте букву, цифру или клавишу знака препинания
|
||||
Pressure Sensitive Чувствительные к нажиму
|
||||
Flex Ribbon Гибкая лента
|
||||
Pulse Stroke Пульсирующий штрих
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3113,6 +3113,8 @@ digits Malayalam Malayalam
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Mushjulet med Cmd/Ctrl nedtryckt rullar arbetsytan i sidled.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Att dra i sidled på ett sifferfälts etikett ändrar fältets värde.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. En rotationsgest med två fingrar på en styrplatta roterar arbetsytans vy.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Om du håller ned en tangent körs verktyget eller kommandot i dess Håll-kolumn i Kortkommandon; ett kort tryck kör dess vanliga kortkommando.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Hur många sekunder en tangent måste hållas ned innan dess hållkortkommando körs i stället för dess vanliga kortkommando.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. När du flyttar ankarpunkter behåller varje kurva med en flyttad ände sin form i förhållande till sina ändar.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. När du håller ned ett verktygs kortkommando är verktyget valt tills du släpper, och sedan väljs det föregående verktyget igen.
|
||||
Shows the bounding box while you move the selection or draw a shape. Visar avgränsningsramen medan du flyttar markeringen eller ritar en form.
|
||||
@@ -10099,6 +10101,16 @@ digits Hindi Hindi
|
||||
@msg A joint does not close by {gap} pt. En fog sluter inte med {gap} pt.
|
||||
@msg Two panels pass through each other. Två paneler går igenom varandra.
|
||||
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} pixlar är för stort för PSD (högst {MAX_SIDE} pixlar per sida): sänk upplösningen
|
||||
Tap Kort tryck
|
||||
Clear Hold Rensa håll
|
||||
Hold Shortcuts Hållkortkommandon
|
||||
Hold Shortcut Delay Fördröjning för hållkortkommandon
|
||||
How hold shortcuts work Så fungerar hållkortkommandon
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klicka och tryck sedan på en tangent som ska hållas ned för detta (Esc avbryter). Att hålla ned tangenten kör detta; ett kort tryck kör tangentens eget kortkommando.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Ett kort tryck på en tangent kör dess kortkommando. Att hålla ned tangenten under fördröjningen kör i stället verktyget eller kommandot i dess Håll-kolumn. Ett hållkortkommando är en bokstavs-, siffer- eller skiljeteckentangent, ensam eller med Shift.
|
||||
@msg Hold {_1} is already used by {_2} Håll {_1} används redan av {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) ett hållkortkommando är en tangent som skriver ett tecken, ensam eller med Shift ({shown} har Cmd, Ctrl eller Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} kan inte vara ett hållkortkommando: använd en bokstav, en siffra eller en skiljeteckentangent
|
||||
Pressure Sensitive Tryckkänslig
|
||||
Flex Ribbon Flexibelt band
|
||||
Pulse Stroke Pulserande drag
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2961,6 +2961,8 @@ digits Malayalam Malayalam
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Cmd/Ctrl basılıyken fare tekerleği tuvali yana kaydırır.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Sayısal bir alanın etiketi üzerinde yana sürüklemek alanın değerini değiştirir.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. İzleme dörtgeninde iki parmakla döndürme hareketi tuvalin görünümünü döndürür.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Bir tuşu basılı tutmak, Klavye Kısayolları'ndaki Basılı tutun sütununda bulunan aracı veya komutu çalıştırır; kısa basış olağan kısayolunu çalıştırır.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Olağan kısayolu yerine basılı tutma kısayolunun çalışması için bir tuşun kaç saniye basılı tutulması gerektiği.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Bağlantı noktalarını taşıdığınızda, bir ucu taşınan her eğri uçlarına göre şeklini korur.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Bir aracın kısayol tuşunu basılı tutmak, tuşu bırakana kadar o aracı seçer, ardından önceki araç yeniden seçilir.
|
||||
Shows the bounding box while you move the selection or draw a shape. Seçimi taşırken veya bir şekil çizerken sınırlayıcı kutuyu gösterir.
|
||||
@@ -10336,6 +10338,16 @@ breakText Glyphs Glifler
|
||||
No objects are selected. Hiçbir nesne seçili değil.
|
||||
Open a document to mark its fold lines. Katlama çizgilerini işaretlemek için bir belgeyi açın.
|
||||
Remove Fold Line Role Çizgi Türünü Kaldır
|
||||
Tap Kısa Basma
|
||||
Clear Hold Basılı Tutmayı Temizle
|
||||
Hold Shortcuts Basılı Tutma Kısayolları
|
||||
Hold Shortcut Delay Basılı Tutma Kısayolu Gecikmesi
|
||||
How hold shortcuts work Basılı tutma kısayolları nasıl çalışır
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Tıklayın, ardından bunun için basılı tutulacak tuşa basın (Esc iptal edilir). Tuşu basılı tutmak bunu çalıştırır; kısa basmak tuşun kendi kısayolunu çalıştırır.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Bir tuşa kısa basmak onun kısayolunu çalıştırır. Tuşu gecikme süresi boyunca basılı tutmak bunun yerine Basılı tutun sütunundaki aracı veya komutu çalıştırır. Basılı tutma kısayolu, tek başına veya Shift ile bir harf, rakam ya da noktalama tuşudur.
|
||||
@msg Hold {_1} is already used by {_2} Basılı tutma {_1} zaten {_2} tarafından kullanılıyor
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) basılı tutma kısayolu, tek başına veya Shift ile bir karakter yazan tuştur ({shown} Cmd, Ctrl veya Alt içeriyor)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} basılı tutma kısayolu olamaz: bir harf, rakam veya noktalama tuşu kullanın
|
||||
Check Denetle
|
||||
Check Fold Lines Katlama Çizgilerini Denetle
|
||||
@msg No cut lines are in the selection. Seçimde kesim çizgisi yok.
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3234,6 +3234,8 @@ digits Malayalam Малаялам
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Колесо миші з натиснутою Cmd/Ctrl прокручує полотно по горизонталі.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Перетягування вбік по підпису числового поля змінює значення поля.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Жест обертання двома пальцями на трекпаді обертає вигляд полотна.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Утримання клавіші запускає інструмент або команду з її стовпця «Утримувати» в «Поєднаннях клавіш»; коротке натискання запускає її звичайне поєднання.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Скільки секунд потрібно утримувати клавішу, перш ніж замість її звичайного поєднання спрацює поєднання утримання.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Коли ви переміщуєте опорні точки, кожна крива з одним переміщеним кінцем зберігає форму відносно своїх кінців.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Поки ви утримуєте клавішу інструмента, його вибрано, а після відпускання знову вибирається попередній інструмент.
|
||||
Shows the bounding box while you move the selection or draw a shape. Показує обмежувальну рамку, поки ви переміщуєте виділення або малюєте фігуру.
|
||||
@@ -9999,6 +10001,16 @@ breakText Glyphs Гліфи
|
||||
No objects are selected. Об’єкти не виділено.
|
||||
Open a document to mark its fold lines. Відкрийте документ, щоб позначити його лінії згину.
|
||||
Remove Fold Line Role Прибрати тип лінії
|
||||
Tap Коротке натискання
|
||||
Clear Hold Очистити утримання
|
||||
Hold Shortcuts Клавіші утримання
|
||||
Hold Shortcut Delay Затримка клавіш утримання
|
||||
How hold shortcuts work Як працюють клавіші утримання
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Клацніть, потім натисніть клавішу, яку слід утримувати для цього (Esc скасовує). Утримання клавіші запускає це; коротке натискання запускає власне сполучення клавіші.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Коротке натискання клавіші запускає її сполучення. Утримання клавіші протягом затримки запускає натомість інструмент або команду з її стовпця «Утримувати». Клавіша утримання — це клавіша літери, цифри або розділового знака, окремо або з Shift.
|
||||
@msg Hold {_1} is already used by {_2} Утримання {_1} вже використовується для {_2}
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) клавіша утримання — це клавіша, що вводить символ, окремо або з Shift ({shown} містить Cmd, Ctrl або Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} не може бути клавішею утримання: використайте літеру, цифру або клавішу розділового знака
|
||||
Check Перевірити
|
||||
Check Fold Lines Перевірити лінії згину
|
||||
@msg No cut lines are in the selection. У виділенні немає ліній різу.
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3550,6 +3550,8 @@ mark-style Japanese Kiểu Nhật
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Con lăn chuột kèm giữ Cmd/Ctrl cuộn khung vẽ sang ngang.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Kéo sang ngang trên nhãn của một trường số sẽ thay đổi giá trị của trường.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Cử chỉ xoay bằng hai ngón trên bàn di chuột sẽ xoay khung nhìn của khung vẽ.
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Giữ một phím sẽ chạy công cụ hoặc lệnh trong cột Giữ của Phím tắt; nhấn nhanh sẽ chạy phím tắt thông thường của phím đó.
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Số giây phải giữ một phím trước khi phím tắt nhấn giữ của nó chạy thay cho phím tắt thông thường.
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. Khi bạn di chuyển điểm neo, mỗi đường cong có một đầu bị di chuyển sẽ giữ hình dạng so với các đầu của nó.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Giữ phím tắt của một công cụ sẽ chọn công cụ đó cho đến khi bạn thả ra, rồi công cụ trước đó được chọn lại.
|
||||
Shows the bounding box while you move the selection or draw a shape. Hiển thị hộp giới hạn khi bạn di chuyển vùng chọn hoặc vẽ một hình.
|
||||
@@ -8257,6 +8259,16 @@ breakText Glyphs Glyph
|
||||
@msg {width} × {height} pixels is too large for Targa (at most 65535 pixels a side): lower the resolution {width} × {height} điểm ảnh quá lớn cho Targa (tối đa 65535 điểm ảnh mỗi cạnh): hãy giảm độ phân giải
|
||||
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} điểm ảnh quá lớn cho PSD (tối đa {MAX_SIDE} điểm ảnh mỗi cạnh): hãy giảm độ phân giải
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer phải là "singleLine", "everyLine", "standardSingleLine" hoặc "standardEveryLine"
|
||||
Tap Nhấn nhanh
|
||||
Clear Hold Xóa nhấn giữ
|
||||
Hold Shortcuts Phím tắt nhấn giữ
|
||||
Hold Shortcut Delay Độ trễ phím tắt nhấn giữ
|
||||
How hold shortcuts work Cách phím tắt nhấn giữ hoạt động
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Nhấp, rồi nhấn phím cần giữ cho mục này (Esc để hủy). Giữ phím sẽ chạy mục này; nhấn nhanh sẽ chạy phím tắt riêng của phím đó.
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Nhấn nhanh một phím sẽ chạy phím tắt của phím đó. Giữ phím trong khoảng độ trễ sẽ chạy công cụ hoặc lệnh trong cột Giữ của phím thay vào đó. Phím tắt nhấn giữ là một phím chữ cái, chữ số hoặc dấu câu, dùng riêng hoặc cùng Shift.
|
||||
@msg Hold {_1} is already used by {_2} Nhấn giữ {_1} đã được {_2} sử dụng
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) phím tắt nhấn giữ là một phím gõ ra ký tự, dùng riêng hoặc cùng Shift ({shown} có Cmd, Ctrl hoặc Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} không thể là phím tắt nhấn giữ: hãy dùng chữ cái, chữ số hoặc phím dấu câu
|
||||
@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first một đường thẳng hoặc đường dẫn mở khác không bao quanh vùng nào sẽ không thêm vùng nào vào hình phức hợp; để đưa nó vào, trước tiên hãy áp dụng Đối tượng › Đường dẫn › Đường bao nét cho nó
|
||||
Pressure Sensitive Nhạy áp lực
|
||||
Flex Ribbon Dải mềm
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3091,6 +3091,8 @@ digits Malayalam 马拉雅拉姆数字
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. 按住 Cmd/Ctrl 滚动鼠标滚轮会横向滚动画布。
|
||||
Dragging sideways on a numeric field's label changes the field's value. 在数值字段的标签上横向拖动可更改字段的值。
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. 在触控板上用双指旋转手势可旋转画布视图。
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. 按住某个键会运行键盘快捷键中其按住列的工具或命令;快速按下则运行其常规快捷键。
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. 按住某个键多少秒后,运行其按住快捷键而不是常规快捷键。
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. 移动锚点时,只有一端移动的每条曲线都会保持其相对于两端的形状。
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. 按住工具的快捷键时选择该工具,松开后重新选择之前的工具。
|
||||
Shows the bounding box while you move the selection or draw a shape. 移动所选对象或绘制形状时显示定界框。
|
||||
@@ -10255,6 +10257,16 @@ breakText Glyphs 字形
|
||||
@msg A joint does not close by {gap} pt. 有一处接缝相差 {gap} pt 未闭合。
|
||||
@msg Two panels pass through each other. 两个面板相互穿插。
|
||||
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} 像素对 PSD 而言过大 (每边最多 {MAX_SIDE} 像素):请降低分辨率
|
||||
Tap 短按
|
||||
Clear Hold 清除按住
|
||||
Hold Shortcuts 按住快捷键
|
||||
Hold Shortcut Delay 按住快捷键延迟
|
||||
How hold shortcuts work 按住快捷键的工作方式
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. 单击后按下要为此按住的键 (Esc 取消)。按住该键会运行此项;短按会运行该键自己的快捷键。
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. 短按一个键会运行它的快捷键。按住该键达到延迟时间,则改为运行其“按住”列中的工具或命令。按住快捷键是字母、数字或标点键,可单独使用或与 Shift 组合。
|
||||
@msg Hold {_1} is already used by {_2} 按住 {_1} 已被 {_2} 使用
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) 按住快捷键是可输入字符的键,单独使用或与 Shift 组合 ({shown} 含有 Cmd、Ctrl 或 Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} 不能作为按住快捷键:请使用字母、数字或标点键
|
||||
Pressure Sensitive 压感画笔
|
||||
Flex Ribbon 柔韧色带
|
||||
Pulse Stroke 脉动笔触
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4442,6 +4442,8 @@ digits Malayalam 馬來亞拉姆數字
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. 按住 Cmd/Ctrl 捲動滑鼠滾輪會橫向捲動畫布。
|
||||
Dragging sideways on a numeric field's label changes the field's value. 在數值欄位的標籤上橫向拖曳可變更欄位的值。
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. 在觸控式軌跡板上以雙指旋轉手勢可旋轉畫布檢視。
|
||||
Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. 按住某個鍵會執行鍵盤快速鍵中其按住欄的工具或命令;快速按下則執行其一般快速鍵。
|
||||
How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. 按住某個鍵多少秒後,執行其按住快速鍵而不是一般快速鍵。
|
||||
When you move anchor points, each curve with one moved end keeps its shape relative to its ends. 移動錨點時,只有一端移動的每條曲線都會保持其相對於兩端的形狀。
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. 按住工具的快速鍵時選擇該工具,放開後重新選擇之前的工具。
|
||||
Shows the bounding box while you move the selection or draw a shape. 移動選取範圍或繪製形狀時顯示邊框。
|
||||
@@ -10070,6 +10072,16 @@ breakText Glyphs 字符
|
||||
@msg A joint does not close by {gap} pt. 有一處接縫相差 {gap} pt 未閉合。
|
||||
@msg Two panels pass through each other. 兩個面板相互穿插。
|
||||
@msg {what} would print on more than {MAX_TILES} tiles: scale it down {what} 會列印在超過 {MAX_TILES} 個拼貼上:請縮小
|
||||
Tap 短按
|
||||
Clear Hold 清除按住
|
||||
Hold Shortcuts 按住快速鍵
|
||||
Hold Shortcut Delay 按住快速鍵延遲
|
||||
How hold shortcuts work 按住快速鍵的運作方式
|
||||
Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. 按一下後按下要為此按住的按鍵 (Esc 取消)。按住該按鍵會執行此項;短按會執行該按鍵本身的快速鍵。
|
||||
A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. 短按按鍵會執行它的快速鍵。按住按鍵達延遲時間,則改為執行其「按住」欄中的工具或命令。按住快速鍵是字母、數字或標點符號按鍵,可單獨使用或搭配 Shift。
|
||||
@msg Hold {_1} is already used by {_2} 按住 {_1} 已被 {_2} 使用
|
||||
@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) 按住快速鍵是可輸入字元的按鍵,可單獨使用或搭配 Shift ({shown} 含有 Cmd、Ctrl 或 Alt)
|
||||
@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} 不能作為按住快速鍵:請使用字母、數字或標點符號按鍵
|
||||
Pressure Sensitive 壓感筆刷
|
||||
Flex Ribbon 柔韌色帶
|
||||
Pulse Stroke 脈動筆觸
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -378,6 +378,9 @@ pub struct VectorcraftApp {
|
||||
/// The single-key tool shortcuts held down, the last held last, and the tool each goes back to
|
||||
/// when it is let go ([`shortcuts::HeldTool`]).
|
||||
pub(crate) held_tool: Vec<shortcuts::HeldTool>,
|
||||
/// A key with a hold shortcut that waits for its release, and the keys whose repeats are held
|
||||
/// back until they are let go ([`shortcuts::HoldKeys`]).
|
||||
pub(crate) hold_keys: shortcuts::HoldKeys,
|
||||
/// A synthetic batch is in the host's raw input and no settled UI pass has taken it yet.
|
||||
synthetic_injected: bool,
|
||||
/// The exact events of [`Self::synthetic_injected`], to remove them if the state they belong
|
||||
|
||||
@@ -191,8 +191,13 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"Cmd+I",
|
||||
"{} open the Check Spelling dialog to walk through unrecognized words with suggestions, ignore, change and dictionary options",
|
||||
),
|
||||
("shortcuts.set", "Set Keyboard Shortcut", "", "{id: command id or tool:<id>, shortcut: \"Cmd+Shift+K\" | \"\" (none) | null (default), force?}"),
|
||||
("shortcuts.list", "List Keyboard Shortcuts", "", "{query?} → [{id, label, group, shortcut, default, overridden}]"),
|
||||
(
|
||||
"shortcuts.set",
|
||||
"Set Keyboard Shortcut",
|
||||
"",
|
||||
"{id: command id or tool:<id>, shortcut?: \"Cmd+Shift+K\" | \"\" (none) | null (default), hold?: a character key alone or with Shift (\"X\", \"Shift+X\", \".\") | \"\" | null (none), force?} → {id, shortcut, hold, removedFrom}; `hold` alone leaves the shortcut as it is; a command listed only with a shortcut takes a hold only with one and loses it with the shortcut; a hold shortcut acts while the holdShortcuts preference is on",
|
||||
),
|
||||
("shortcuts.list", "List Keyboard Shortcuts", "", "{query?} → [{id, label, group, shortcut, hold, default, overridden}]"),
|
||||
("shortcuts.conflicts", "Keyboard Shortcut Conflicts", "", "{} → [{shortcut, ids}]"),
|
||||
("shortcuts.reset", "Reset Keyboard Shortcuts", "", "{}"),
|
||||
(
|
||||
@@ -206,7 +211,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"shortcuts.exportText",
|
||||
"Export Keyboard Shortcuts as Text…",
|
||||
"",
|
||||
"{path?, format?: \"text\"|\"sheet\"|\"csv\" (default text), pageSize?: \"letter\"|\"a4\" (sheet only; default A4 when the current document prints on A4, else letter)} save the current set's tools and menu commands with their shortcuts (Keyboard Shortcuts › Export Text…). text: a UTF-8 text file: the set's name, then a Tools and a Menu Commands section in the dialog's order, one `name<TAB>shortcut` line per row, empty after the tab when it has none. sheet: a printable PDF on landscape pages that lists the rows with a shortcut, Tools and then a group per top-level menu, under a colored band per group, shortcut then name, in four columns. csv: a UTF-8 CSV file (RFC 4180 quoting, CRLF) with a `Group,Command,Shortcut` header and one record per row in the sheet's groups, in the UI language; a field that starts with = + - @ and has more after it starts with '. A `path` is written as given. Without it, pick a file: the desktop save dialog offers the three formats (text first) unless `format` names one, and the file type picked decides and gives the name its extension; with no dialog, writer or download, returns {text} (text, csv) or {pdf: base64} (sheet); a bad `format` or `pageSize` is an error",
|
||||
"{path?, format?: \"text\"|\"sheet\"|\"csv\" (default text), pageSize?: \"letter\"|\"a4\" (sheet only; default A4 when the current document prints on A4, else letter)} save the current set's tools and menu commands with their shortcuts (Keyboard Shortcuts › Export Text…). text: a UTF-8 text file: the set's name, then a Tools and a Menu Commands section in the dialog's order, one `name<TAB>shortcut` line per row, empty after the tab when it has none, and while the holdShortcuts preference is on a third `Hold <key>` column on a row with a hold shortcut. sheet: a printable PDF on landscape pages that lists the rows with a shortcut, Tools and then a group per top-level menu, under a colored band per group, shortcut then name, in four columns. csv: a UTF-8 CSV file (RFC 4180 quoting, CRLF) with a `Group,Command,Shortcut` header and one record per row in the sheet's groups, in the UI language; a field that starts with = + - @ and has more after it starts with '. A `path` is written as given. Without it, pick a file: the desktop save dialog offers the three formats (text first) unless `format` names one, and the file type picked decides and gives the name its extension; with no dialog, writer or download, returns {text} (text, csv) or {pdf: base64} (sheet); a bad `format` or `pageSize` is an error",
|
||||
),
|
||||
("shortcuts.import", "Import Keyboard Shortcuts…", "", "{path? | data?}"),
|
||||
(
|
||||
|
||||
@@ -32,6 +32,11 @@ pub fn open(app: &mut VectorcraftApp, category: Option<&str>) {
|
||||
// One field per preference key or group (the flattener presets have commands of their own).
|
||||
let mut fields: Map<String, Value> = app.session.prefs.to_json().as_object().cloned().unwrap_or_default();
|
||||
fields.retain(|k, _| vectorcraft_engine::cmd::prefscmds::spec(k).is_some() || PREF_GROUPS.contains(&k.as_str()));
|
||||
// A restored settings file can hold a Hold Shortcut Delay outside its range: the dialog shows,
|
||||
// and OK sets, the delay in use.
|
||||
if fields.contains_key("keyHoldDelay") {
|
||||
fields.insert("keyHoldDelay".into(), json!(app.session.prefs.key_hold_delay()));
|
||||
}
|
||||
// Units ▸ General shows (and OK sets) the open document's units.
|
||||
if let Some(st) = app.session.active() {
|
||||
fields.insert("unitsGeneral".into(), json!(st.doc.units.key()));
|
||||
@@ -665,22 +670,7 @@ fn category_fields(ui: &mut egui::Ui, app: &mut VectorcraftApp, d: &mut Dialog,
|
||||
// says the change applies at the next start.
|
||||
PrefKind::Bool if sp.key == "lowLatencyDrawing" => desktop_startup_bool_row(ui, d, sp.key, sp.label, &t),
|
||||
PrefKind::Bool => bool_row(ui, d, sp.key, sp.label),
|
||||
PrefKind::Num { min, max, unit } => {
|
||||
labeled(ui, sp.label, |ui, label_id| {
|
||||
let mut x = v.as_f64().unwrap_or(min);
|
||||
let new = if sp.key == "uiScaling" {
|
||||
// Without internal text, both slider controls inherit the row's name across focus changes.
|
||||
let response = widgets::slider(ui, egui::Slider::new(&mut x, min..=max).step_by(0.05)).labelled_by(label_id);
|
||||
ui.add(egui::Label::new(tl!("Smaller ↔ Larger")).wrap_mode(egui::TextWrapMode::Extend));
|
||||
response.changed().then_some(x)
|
||||
} else {
|
||||
widgets::range_field(ui, sp.key, x, min..=max, &format!(" {unit}"), 3, 110.0)
|
||||
};
|
||||
if let Some(x) = new {
|
||||
d.fields.insert(sp.key.into(), json!(x));
|
||||
}
|
||||
});
|
||||
}
|
||||
PrefKind::Num { min, max, unit } => num_row(ui, d, sp.key, sp.label, min..=max, unit, &v),
|
||||
PrefKind::Length { min, max, measure } => {
|
||||
// In the dialog's own Units choice, so a change there shows right away.
|
||||
let unit = vectorcraft_doc::Unit::named(&d.str(measure.pref_key())).unwrap_or_default();
|
||||
@@ -879,6 +869,38 @@ fn choice_row(ui: &mut egui::Ui, d: &mut Dialog, key: &str, label: &str, opts: &
|
||||
});
|
||||
}
|
||||
|
||||
/// The row of the number preference `key` within `range`: a slider for Interface Scaling, a field
|
||||
/// shown with `unit` otherwise.
|
||||
fn num_row(ui: &mut egui::Ui, d: &mut Dialog, key: &str, label: &str, range: std::ops::RangeInclusive<f64>, unit: &str, v: &Value) {
|
||||
if key == "uiScaling" {
|
||||
labeled(ui, label, |ui, label_id| {
|
||||
let mut x = v.as_f64().unwrap_or(*range.start());
|
||||
// Without internal text, both slider controls inherit the row's name across focus changes.
|
||||
let response = widgets::slider(ui, egui::Slider::new(&mut x, range).step_by(0.05)).labelled_by(label_id);
|
||||
ui.add(egui::Label::new(tl!("Smaller ↔ Larger")).wrap_mode(egui::TextWrapMode::Extend));
|
||||
if response.changed() {
|
||||
d.fields.insert(key.into(), json!(x));
|
||||
}
|
||||
});
|
||||
} else if key == "keyHoldDelay" {
|
||||
// General › Hold Shortcut Delay acts only while Hold Shortcuts is on: dimmed while it
|
||||
// is off, as in Edit › Keyboard Shortcuts, which shows it only then.
|
||||
ui.add_enabled_ui(d.bool("holdShortcuts"), |ui| num_field_row(ui, d, key, label, range, unit, v));
|
||||
} else {
|
||||
num_field_row(ui, d, key, label, range, unit, v);
|
||||
}
|
||||
}
|
||||
|
||||
/// A number field for the preference `key`, kept within `range` and shown with `unit`.
|
||||
fn num_field_row(ui: &mut egui::Ui, d: &mut Dialog, key: &str, label: &str, range: std::ops::RangeInclusive<f64>, unit: &str, v: &Value) {
|
||||
labeled(ui, label, |ui, _| {
|
||||
let x = v.as_f64().unwrap_or(*range.start());
|
||||
if let Some(x) = widgets::range_field(ui, key, x, range, &format!(" {unit}"), 3, 110.0) {
|
||||
d.fields.insert(key.into(), json!(x));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
fn bool_row(ui: &mut egui::Ui, d: &mut Dialog, key: &str, label: &str) {
|
||||
// The app's outlined checkbox (it translates `label`): egui's own has no border at rest.
|
||||
let on = d.bool(key);
|
||||
|
||||
@@ -41,6 +41,8 @@ pub(crate) const DESCRIPTIONS: &[(&str, &str)] = &[
|
||||
("trackpadRotateView", "A two-finger rotate gesture on a trackpad rotates the canvas view."),
|
||||
("interpolateControlPoints", "When you move anchor points, each curve with one moved end keeps its shape relative to its ends."),
|
||||
("holdToolKeys", "Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again."),
|
||||
("holdShortcuts", "Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut."),
|
||||
("keyHoldDelay", "How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut."),
|
||||
("boundingBoxWhileMovingAndDrawing", "Shows the bounding box while you move the selection or draw a shape."),
|
||||
("japaneseCropMarks", "Create Trim Marks draws Japanese-style marks instead of Roman ones."),
|
||||
("newArtBasic", "New art takes only the fill and stroke of the selection; off, it takes the selected object's whole appearance."),
|
||||
|
||||
@@ -1156,6 +1156,60 @@ fn scroll_sideways_with_cmd_wheel_dims_with_zoom_with_mouse_wheel() {
|
||||
}
|
||||
}
|
||||
|
||||
/// General › Hold Shortcut Delay: its field is dimmed while Hold Shortcuts is unchecked in the
|
||||
/// dialog, and a click on it then does not give it the keyboard.
|
||||
#[test]
|
||||
fn hold_shortcut_delay_dims_without_hold_shortcuts() {
|
||||
fn text(s: &egui::Shape, f: &dyn Fn(&str) -> bool) -> Option<egui::Rect> {
|
||||
match s {
|
||||
egui::Shape::Text(t) if f(t.galley.text()) => Some(t.visual_bounding_rect()),
|
||||
egui::Shape::Vec(v) => v.iter().find_map(|s| text(s, f)),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
for on in [true, false] {
|
||||
let ctx = egui::Context::default();
|
||||
crate::theme::install_fonts(&ctx);
|
||||
let mut a = app();
|
||||
let mut d = Dialog::new("preferences", json!({"holdShortcuts": on, "keyHoldDelay": 0.35}));
|
||||
let mut frame = |d: &mut Dialog, events: Vec<egui::Event>| {
|
||||
let raw = egui::RawInput {
|
||||
screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(600.0, 2400.0))),
|
||||
events,
|
||||
..Default::default()
|
||||
};
|
||||
let mut out = ctx.run_ui(raw, |ui| {
|
||||
category_fields(ui, &mut a, d, "General");
|
||||
});
|
||||
out.textures_delta.clear();
|
||||
let label = out.shapes.iter().find_map(|c| text(&c.shape, &|t| t.starts_with("Hold Shortcut Delay")));
|
||||
let field = out.shapes.iter().find_map(|c| text(&c.shape, &|t| t.starts_with("0.35")));
|
||||
(label, field)
|
||||
};
|
||||
let (label, field) = frame(&mut d, vec![]);
|
||||
assert!(label.is_some(), "no label (on {on})");
|
||||
let at = field.unwrap_or_else(|| panic!("no field (on {on})"));
|
||||
let press =
|
||||
|pressed| egui::Event::PointerButton { pos: at.center(), button: egui::PointerButton::Primary, pressed, modifiers: Default::default() };
|
||||
frame(&mut d, vec![egui::Event::PointerMoved(at.center()), press(true)]);
|
||||
frame(&mut d, vec![press(false)]);
|
||||
assert_eq!(ctx.memory(|m| m.focused().is_some()), on, "a click gives the field the keyboard only while Hold Shortcuts is on ({on})");
|
||||
}
|
||||
}
|
||||
|
||||
/// A restored Hold Shortcut Delay outside its range opens as the delay in use, and OK keeps it.
|
||||
#[test]
|
||||
fn a_restored_hold_shortcut_delay_outside_its_range_opens_as_the_delay_in_use() {
|
||||
for (saved, used) in [(5.0, 1.0), (0.05, 0.2)] {
|
||||
let mut a = app();
|
||||
a.session.prefs.key_hold_delay = saved;
|
||||
open(&mut a, Some("General"));
|
||||
assert_eq!(a.ui.dialog.as_ref().unwrap().fields["keyHoldDelay"], json!(used), "{saved}");
|
||||
confirm(&mut a).unwrap();
|
||||
assert_eq!(a.session.prefs.key_hold_delay, used, "{saved}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Type › Show samples on white: its checkbox is dimmed while Enable in-menu font previews is
|
||||
/// unchecked in the dialog, and a click on it then leaves the setting as it was.
|
||||
#[test]
|
||||
|
||||
@@ -1177,6 +1177,100 @@ pub fn reset_one(overrides: &mut Overrides, key: &str) {
|
||||
crate::keymap::remove_override(overrides, key);
|
||||
}
|
||||
|
||||
/// Hold shortcuts: entry key → chord text ([`UiState::shortcut_holds`]).
|
||||
pub type Holds = BTreeMap<String, String>;
|
||||
|
||||
/// The chord of hold shortcut text `text`, or why it can't be one. A hold shortcut is a key that
|
||||
/// types a character, alone or with Shift. Space and the backtick key are refused: the canvas reads
|
||||
/// them while they are held.
|
||||
pub fn hold_chord(text: &str) -> Result<craft_keymap::Chord, String> {
|
||||
let chord = vc_chord(text).ok_or_else(|| format!("can't parse shortcut `{text}`"))?;
|
||||
let shown = menus::pretty_shortcut(&vc_format(&chord));
|
||||
if chord.mods.cmd || chord.mods.ctrl || chord.mods.alt {
|
||||
return Err(format!("a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt)"));
|
||||
}
|
||||
if chord.key == craft_keymap::Key::Backtick || !crate::shortcuts::types_text(chord.key) {
|
||||
return Err(format!("{shown} can't be a hold shortcut: use a letter, a digit or a punctuation key"));
|
||||
}
|
||||
Ok(chord)
|
||||
}
|
||||
|
||||
/// The hold shortcut of `key` in `holds`, in VectorCraft's chord spelling, when it is usable.
|
||||
pub fn hold_of(holds: &Holds, key: &str) -> Option<String> {
|
||||
holds.get(key).and_then(|t| hold_chord(t).ok()).map(|c| vc_format(&c))
|
||||
}
|
||||
|
||||
/// The entry whose usable hold shortcut is `chord`: the first in `holds`' order when several are.
|
||||
/// An entry no longer listed (a removed plug-in's, or one that [`needs_a_value`] whose shortcut
|
||||
/// was taken away) keeps its text but does not hold.
|
||||
pub(crate) fn hold_for<'a>(holds: &'a Holds, chord: &craft_keymap::Chord) -> Option<&'a str> {
|
||||
let mirror = current();
|
||||
holds
|
||||
.iter()
|
||||
.find(|(k, t)| hold_chord(t).is_ok_and(|c| c == *chord) && entry(k).is_some_and(|e| listed(mirror.keymap.overrides(), &e)))
|
||||
.map(|(k, _)| k.as_str())
|
||||
}
|
||||
|
||||
/// Removes the hold shortcuts of the entries the editor does not list under `overrides`: one that
|
||||
/// [`needs_a_value`] loses its hold with its shortcut. A removed plug-in's entry keeps its hold.
|
||||
fn drop_unlisted_holds(holds: &mut Holds, overrides: &Overrides) {
|
||||
holds.retain(|k, _| entry(k).is_none_or(|e| listed(overrides, &e)));
|
||||
}
|
||||
|
||||
/// Sets (`Some`) or removes (`None` or `""`) the hold shortcut of `key`. Another entry that holds
|
||||
/// the same key loses it when `force`; otherwise that is an error. Returns the entries that lost
|
||||
/// it. Nothing changes on an error.
|
||||
pub fn assign_hold(holds: &mut Holds, key: &str, text: Option<&str>, force: bool) -> Result<Vec<String>, String> {
|
||||
if entry(key).is_none() {
|
||||
return Err(format!("unknown tool or command `{key}`"));
|
||||
}
|
||||
let Some(text) = text.filter(|t| !t.is_empty()) else {
|
||||
holds.remove(key);
|
||||
return Ok(vec![]);
|
||||
};
|
||||
let chord = hold_chord(text)?;
|
||||
let taken: Vec<String> = holds.iter().filter(|(k, t)| *k != key && vc_chord(t) == Some(chord)).map(|(k, _)| k.clone()).collect();
|
||||
if !taken.is_empty() && !force {
|
||||
let names: Vec<String> = taken.iter().map(|k| entry(k).map_or(k.clone(), |e| english_name(&e))).collect();
|
||||
return Err(format!("Hold {} is already used by {}", menus::pretty_shortcut(&vc_format(&chord)), names.join(", ")));
|
||||
}
|
||||
for k in &taken {
|
||||
holds.remove(k);
|
||||
}
|
||||
holds.insert(key.to_string(), vc_format(&chord));
|
||||
Ok(taken)
|
||||
}
|
||||
|
||||
/// Hold shortcuts used by more than one entry: (chord text, entry keys).
|
||||
pub fn hold_conflicts(holds: &Holds) -> Vec<(String, Vec<String>)> {
|
||||
let mut by: BTreeMap<String, Vec<String>> = BTreeMap::new();
|
||||
for (k, t) in holds {
|
||||
if let Ok(c) = hold_chord(t) {
|
||||
by.entry(vc_format(&c)).or_default().push(k.clone());
|
||||
}
|
||||
}
|
||||
by.into_iter().filter(|(_, keys)| keys.len() > 1).collect()
|
||||
}
|
||||
|
||||
/// The hold shortcuts of an exported set's `holds` member: none when it is missing. Every value
|
||||
/// must be a usable hold shortcut; otherwise the error names the first entry that is not.
|
||||
pub fn import_holds(v: &Value) -> Result<Holds, String> {
|
||||
let Some(h) = v.get("holds") else { return Ok(Holds::new()) };
|
||||
let h = h.as_object().ok_or("`holds` must be an object")?;
|
||||
let mut out = Holds::new();
|
||||
for (k, v) in h {
|
||||
let s = v.as_str().ok_or_else(|| format!("hold shortcut for `{k}` must be a string"))?;
|
||||
let c = hold_chord(s).map_err(|e| format!("hold shortcut for `{k}`: {e}"))?;
|
||||
out.insert(k.clone(), vc_format(&c));
|
||||
}
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
/// The hold shortcuts of the Keyboard Shortcuts dialog's working set.
|
||||
fn dialog_holds(d: &Dialog) -> Holds {
|
||||
d.fields.get("holds").and_then(|v| serde_json::from_value(v.clone()).ok()).unwrap_or_default()
|
||||
}
|
||||
|
||||
/// Text shown for all active chords in a dialog row, with the backtick key shown as `typed`
|
||||
/// ([`backtick_text`]).
|
||||
fn dialog_shortcuts_with(km: &Keymap, key: &str, typed: Option<&str>) -> Option<String> {
|
||||
@@ -1197,7 +1291,17 @@ pub fn preset(name: &str) -> Option<Overrides> {
|
||||
|
||||
/// Export format: `{"format": "vectorcraft-shortcuts", "set": name, "overrides": {...}}`.
|
||||
pub fn export_json(set: &str, overrides: &Overrides) -> Value {
|
||||
json!({"format": "vectorcraft-shortcuts", "version": 1, "set": set, "overrides": stored::to_value(overrides)})
|
||||
export_json_with(set, overrides, &Holds::new())
|
||||
}
|
||||
|
||||
/// [`export_json`] with the set's hold shortcuts, written as `holds` when there are any. The
|
||||
/// version stays 1: earlier versions read `overrides` only, so they import the file without them.
|
||||
pub fn export_json_with(set: &str, overrides: &Overrides, holds: &Holds) -> Value {
|
||||
let mut v = json!({"format": "vectorcraft-shortcuts", "version": 1, "set": set, "overrides": stored::to_value(overrides)});
|
||||
if !holds.is_empty() {
|
||||
v["holds"] = json!(holds);
|
||||
}
|
||||
v
|
||||
}
|
||||
|
||||
pub fn import_json(v: &Value) -> Result<(String, Overrides), String> {
|
||||
@@ -1217,6 +1321,11 @@ pub fn import_json(v: &Value) -> Result<(String, Overrides), String> {
|
||||
/// row per line with the name and the shortcuts as the dialog shows them, separated by a tab. A
|
||||
/// row with no shortcut ends after the tab.
|
||||
pub fn export_text(set: &str, overrides: &Overrides) -> String {
|
||||
export_text_with(set, overrides, &Holds::new())
|
||||
}
|
||||
|
||||
/// [`export_text`] with the set's hold shortcuts: a row with one gets a third column, `Hold X`.
|
||||
pub fn export_text_with(set: &str, overrides: &Overrides, holds: &Holds) -> String {
|
||||
let snapshot = snapshot();
|
||||
let km = crate::keymap::keymap_in(&snapshot, overrides);
|
||||
let backtick = backtick_text();
|
||||
@@ -1227,7 +1336,10 @@ pub fn export_text(set: &str, overrides: &Overrides) -> String {
|
||||
for e in snapshot.entries.iter().filter(|e| e.is_tool == tools && listed(km.overrides(), e)) {
|
||||
let name = shown_name(e);
|
||||
let sc = dialog_shortcuts_with(&km, &e.key, backtick.as_deref()).unwrap_or_default();
|
||||
out += &format!("{name}\t{sc}\n");
|
||||
match hold_of(holds, &e.key) {
|
||||
Some(h) => out += &format!("{name}\t{sc}\t{} {}\n", tl!("Hold"), menus::pretty_shortcut(&h)),
|
||||
None => out += &format!("{name}\t{sc}\n"),
|
||||
}
|
||||
}
|
||||
}
|
||||
out
|
||||
@@ -1310,8 +1422,9 @@ const MENU_COMMANDS: &str = "Menu Commands";
|
||||
/// Export Text's rows in sections, for the shortcut sheet and the CSV file: Tools, then one section
|
||||
/// per top-level menu in the order the dialog first lists a command of it, with the names and
|
||||
/// shortcuts as the dialog shows them, each name without its top-level menu. Every row the dialog
|
||||
/// lists is there, with an empty shortcut when it has none.
|
||||
pub fn export_sections(overrides: &Overrides) -> Vec<crate::shortcut_sheet::Section> {
|
||||
/// lists is there, with an empty shortcut when it has none. A row with a hold shortcut in `holds`
|
||||
/// ends its shortcuts with `Hold X`, joined as the dialog joins them.
|
||||
pub fn export_sections(overrides: &Overrides, holds: &Holds) -> Vec<crate::shortcut_sheet::Section> {
|
||||
use crate::shortcut_sheet::{Row, Section};
|
||||
let snapshot = snapshot();
|
||||
let km = crate::keymap::keymap_in(&snapshot, overrides);
|
||||
@@ -1320,6 +1433,11 @@ pub fn export_sections(overrides: &Overrides) -> Vec<crate::shortcut_sheet::Sect
|
||||
let mut menus: Vec<Section> = vec![];
|
||||
for e in snapshot.entries.iter().filter(|e| listed(km.overrides(), e)) {
|
||||
let shortcut = dialog_shortcuts_with(&km, &e.key, backtick.as_deref()).unwrap_or_default();
|
||||
let shortcut = match hold_of(holds, &e.key) {
|
||||
Some(h) if shortcut.is_empty() => format!("{} {}", tl!("Hold"), menus::pretty_shortcut(&h)),
|
||||
Some(h) => format!("{shortcut} · {} {}", tl!("Hold"), menus::pretty_shortcut(&h)),
|
||||
None => shortcut,
|
||||
};
|
||||
if e.is_tool {
|
||||
tools.rows.push(Row { name: shown_name(e), shortcut });
|
||||
continue;
|
||||
@@ -1339,14 +1457,20 @@ pub fn export_sections(overrides: &Overrides) -> Vec<crate::shortcut_sheet::Sect
|
||||
}
|
||||
|
||||
/// The file `format` writes for `set` with `overrides`: the sheet on `page`.
|
||||
fn export_text_file(format: TextFormat, set: &str, overrides: &Overrides, page: crate::shortcut_sheet::PageSize) -> Result<Vec<u8>, String> {
|
||||
fn export_text_file(
|
||||
format: TextFormat,
|
||||
set: &str,
|
||||
overrides: &Overrides,
|
||||
holds: &Holds,
|
||||
page: crate::shortcut_sheet::PageSize,
|
||||
) -> Result<Vec<u8>, String> {
|
||||
match format {
|
||||
TextFormat::Text => Ok(export_text(set, overrides).into_bytes()),
|
||||
TextFormat::Text => Ok(export_text_with(set, overrides, holds).into_bytes()),
|
||||
TextFormat::Sheet => {
|
||||
let title = format!("{} · {}", tl!("Keyboard Shortcuts"), shown_set_name(set));
|
||||
crate::shortcut_sheet::sheet_pdf(&title, &export_sections(overrides), page)
|
||||
crate::shortcut_sheet::sheet_pdf(&title, &export_sections(overrides, holds), page)
|
||||
}
|
||||
TextFormat::Csv => Ok(crate::shortcut_sheet::csv(&export_sections(overrides), ["Group", "Command", "Shortcut"]).into_bytes()),
|
||||
TextFormat::Csv => Ok(crate::shortcut_sheet::csv(&export_sections(overrides, holds), ["Group", "Command", "Shortcut"]).into_bytes()),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1372,10 +1496,35 @@ pub fn open(app: &mut VectorcraftApp) {
|
||||
let ov = stored::to_value(&app.ui.shortcut_overrides);
|
||||
app.ui.dialog = Some(Dialog::new(
|
||||
"shortcuts",
|
||||
json!({"tab": "tools", "query": "", "set": app.ui.shortcut_set, "overrides": ov, "__recording": "", "__selected": "", "__message": "", "__conflict": ""}),
|
||||
json!({
|
||||
"tab": "tools",
|
||||
"query": "",
|
||||
"set": app.ui.shortcut_set,
|
||||
"overrides": ov,
|
||||
"holds": app.ui.shortcut_holds,
|
||||
"holdShortcuts": app.session.prefs.hold_shortcuts,
|
||||
"keyHoldDelay": app.session.prefs.key_hold_delay(),
|
||||
"__holdInfo": false,
|
||||
"__recording": "",
|
||||
"__recordingHold": false,
|
||||
"__selected": "",
|
||||
"__message": "",
|
||||
"__conflict": ""
|
||||
}),
|
||||
));
|
||||
}
|
||||
|
||||
/// Hold Shortcuts in the Keyboard Shortcuts dialog's working copy.
|
||||
fn dialog_holds_on(d: &Dialog) -> bool {
|
||||
d.bool("holdShortcuts")
|
||||
}
|
||||
|
||||
/// The Hold Shortcut Delay in the Keyboard Shortcuts dialog's working copy, in its range.
|
||||
fn dialog_hold_delay(d: &Dialog) -> f64 {
|
||||
let (min, max) = vectorcraft_engine::KEY_HOLD_DELAY_RANGE;
|
||||
d.fields.get("keyHoldDelay").and_then(Value::as_f64).filter(|x| x.is_finite()).map_or(vectorcraft_engine::KEY_HOLD_DELAY, |x| x.clamp(min, max))
|
||||
}
|
||||
|
||||
fn dialog_overrides(d: &Dialog) -> Overrides {
|
||||
d.fields.get("overrides").map(|v| stored::from_value(v.clone())).unwrap_or_default()
|
||||
}
|
||||
@@ -1383,7 +1532,16 @@ fn dialog_overrides(d: &Dialog) -> Overrides {
|
||||
/// OK: commit the working set.
|
||||
pub fn confirm(app: &mut VectorcraftApp) -> Result<Value, String> {
|
||||
let Some(d) = app.ui.dialog.clone() else { return Err("no dialog open".into()) };
|
||||
let (on, delay) = (dialog_holds_on(&d), dialog_hold_delay(&d));
|
||||
let prefs = &app.session.prefs;
|
||||
if d.kind == "shortcuts" && (on != prefs.hold_shortcuts || delay != prefs.key_hold_delay()) {
|
||||
app.run("prefs.set", json!({"values": {"holdShortcuts": on, "keyHoldDelay": delay}})).map_err(|e| e.to_string())?;
|
||||
// Saved as OK in Preferences saves them.
|
||||
crate::prefs_dialog::snapshot(app);
|
||||
app.prefs_changed = true;
|
||||
}
|
||||
app.ui.shortcut_overrides = dialog_overrides(&d);
|
||||
app.ui.shortcut_holds = dialog_holds(&d);
|
||||
app.ui.shortcut_set = d.str("set");
|
||||
app.ui.dialog = None;
|
||||
sync(&app.ui);
|
||||
@@ -1413,18 +1571,50 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Resu
|
||||
(Ok(key), Ok(shortcut), Ok(force)) => (key.unwrap_or_default(), shortcut, force.unwrap_or(false)),
|
||||
(Err(e), _, _) | (_, Err(e), _) | (_, _, Err(e)) => return Some(Err(e)),
|
||||
};
|
||||
let hold = match s("hold") {
|
||||
Ok(hold) => hold,
|
||||
Err(e) => return Some(Err(e)),
|
||||
};
|
||||
// Without `hold`, a missing `shortcut` removes the shortcut, as it always has; with
|
||||
// `hold` alone, the shortcut is left as it is. Both are checked before either is kept.
|
||||
let has_hold = p.get("hold").is_some();
|
||||
let has_shortcut = p.get("shortcut").is_some() || !has_hold;
|
||||
let mut ov = app.ui.shortcut_overrides.clone();
|
||||
let r = if p.get("shortcut").is_some_and(Value::is_null) {
|
||||
let mut holds = app.ui.shortcut_holds.clone();
|
||||
let r = if !has_shortcut {
|
||||
Ok(vec![])
|
||||
} else if p.get("shortcut").is_some_and(Value::is_null) {
|
||||
reset_one(&mut ov, &key);
|
||||
Ok(vec![])
|
||||
} else {
|
||||
assign(&mut ov, &key, shortcut.as_deref(), force)
|
||||
};
|
||||
let r = r.and_then(|mut removed| {
|
||||
// An entry the editor lists only with a shortcut takes a hold shortcut only with one.
|
||||
if hold.as_deref().is_some_and(|h| !h.is_empty()) && entry(&key).is_some_and(|e| !listed(&ov, &e)) {
|
||||
return Err(format!("`{key}` needs a shortcut before it can have a hold shortcut"));
|
||||
}
|
||||
if has_hold {
|
||||
for k in assign_hold(&mut holds, &key, hold.as_deref(), force)? {
|
||||
if !removed.contains(&k) {
|
||||
removed.push(k);
|
||||
}
|
||||
}
|
||||
}
|
||||
drop_unlisted_holds(&mut holds, &ov);
|
||||
Ok(removed)
|
||||
});
|
||||
r.map(|removed| {
|
||||
app.ui.shortcut_overrides = ov;
|
||||
app.ui.shortcut_holds = holds;
|
||||
app.ui.shortcut_set = CUSTOM.into();
|
||||
sync(&app.ui);
|
||||
json!({"id": key, "shortcut": effective_in(&app.ui.shortcut_overrides, &key), "removedFrom": removed})
|
||||
json!({
|
||||
"id": key,
|
||||
"shortcut": effective_in(&app.ui.shortcut_overrides, &key),
|
||||
"hold": hold_of(&app.ui.shortcut_holds, &key),
|
||||
"removedFrom": removed
|
||||
})
|
||||
})
|
||||
}
|
||||
"shortcuts.list" => {
|
||||
@@ -1441,15 +1631,19 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Resu
|
||||
.iter()
|
||||
.filter(|e| listed(ov, e))
|
||||
.filter(|e| q.is_empty() || e.label.to_lowercase().contains(&q) || e.key.to_lowercase().contains(&q))
|
||||
.map(|e| json!({"id": e.key, "label": e.label, "group": e.group, "shortcut": effective_with(&km, &e.key), "default": default_of(&e.key), "overridden": crate::keymap::has_override(ov, &e.key)}))
|
||||
.map(|e| json!({"id": e.key, "label": e.label, "group": e.group, "shortcut": effective_with(&km, &e.key), "hold": hold_of(&app.ui.shortcut_holds, &e.key), "default": default_of(&e.key), "overridden": crate::keymap::has_override(ov, &e.key)}))
|
||||
.collect(),
|
||||
))
|
||||
}
|
||||
"shortcuts.conflicts" => {
|
||||
Ok(json!(all_conflicts(&app.ui.shortcut_overrides).into_iter().map(|(c, k)| json!({"shortcut": c, "ids": k})).collect::<Vec<_>>()))
|
||||
let holds = hold_conflicts(&app.ui.shortcut_holds).into_iter().map(|(c, k)| (format!("Hold {c}"), k));
|
||||
Ok(json!(
|
||||
all_conflicts(&app.ui.shortcut_overrides).into_iter().chain(holds).map(|(c, k)| json!({"shortcut": c, "ids": k})).collect::<Vec<_>>()
|
||||
))
|
||||
}
|
||||
"shortcuts.reset" => {
|
||||
app.ui.shortcut_overrides.clear();
|
||||
app.ui.shortcut_holds.clear();
|
||||
app.ui.shortcut_set = PRESETS[0].into();
|
||||
sync(&app.ui);
|
||||
Ok(Value::Null)
|
||||
@@ -1457,6 +1651,8 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Resu
|
||||
"shortcuts.preset" => match s("name").map(|n| n.as_deref().map(set_name).and_then(|n| preset(n).map(|p| (n.to_string(), p)))) {
|
||||
Ok(Some((n, p))) => {
|
||||
app.ui.shortcut_overrides = p;
|
||||
// The presets have no hold shortcuts.
|
||||
app.ui.shortcut_holds.clear();
|
||||
app.ui.shortcut_set = n;
|
||||
sync(&app.ui);
|
||||
Ok(Value::Null)
|
||||
@@ -1469,7 +1665,7 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Resu
|
||||
Ok(path) => path,
|
||||
Err(e) => return Some(Err(e)),
|
||||
};
|
||||
let v = export_json(&app.ui.shortcut_set, &app.ui.shortcut_overrides);
|
||||
let v = export_json_with(&app.ui.shortcut_set, &app.ui.shortcut_overrides, &app.ui.shortcut_holds);
|
||||
let bytes = serde_json::to_vec_pretty(&v).unwrap_or_default();
|
||||
let pick = crate::FilePick {
|
||||
filters: vec![crate::FilePick::filter("Shortcut sets", &["json"])],
|
||||
@@ -1554,7 +1750,9 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Resu
|
||||
if path.is_none() && app.file_dialog_open() {
|
||||
return Some(Err("cancelled".into()));
|
||||
}
|
||||
let bytes = match export_text_file(format, &app.ui.shortcut_set, &app.ui.shortcut_overrides, page) {
|
||||
// The hold shortcuts are listed while they act.
|
||||
let holds = if app.session.prefs.hold_shortcuts { app.ui.shortcut_holds.clone() } else { Holds::new() };
|
||||
let bytes = match export_text_file(format, &app.ui.shortcut_set, &app.ui.shortcut_overrides, &holds, page) {
|
||||
Ok(bytes) => bytes,
|
||||
Err(e) => return Some(Err(e)),
|
||||
};
|
||||
@@ -1599,13 +1797,16 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Resu
|
||||
(_, None) => Err("no file reader".into()),
|
||||
}
|
||||
};
|
||||
data.and_then(|v| import_json(&v)).map(|(set, ov)| {
|
||||
data.and_then(|v| Ok((import_json(&v)?, import_holds(&v)?))).map(|((set, ov), mut holds)| {
|
||||
let n = ov.len();
|
||||
drop_unlisted_holds(&mut holds, &ov);
|
||||
app.ui.shortcut_overrides = ov;
|
||||
app.ui.shortcut_holds = holds;
|
||||
app.ui.shortcut_set = set;
|
||||
sync(&app.ui);
|
||||
if let Some(d) = app.ui.dialog.as_mut().filter(|d| d.kind == "shortcuts") {
|
||||
d.fields.insert("overrides".into(), stored::to_value(&app.ui.shortcut_overrides));
|
||||
d.fields.insert("holds".into(), json!(app.ui.shortcut_holds));
|
||||
d.fields.insert("set".into(), json!(app.ui.shortcut_set));
|
||||
}
|
||||
json!({"overrides": n})
|
||||
@@ -1691,7 +1892,10 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
let mut cancel = false;
|
||||
drop_hidden(&mut d, km.overrides());
|
||||
let saved = dialog_overrides(&d);
|
||||
let mut holds = dialog_holds(&d);
|
||||
let recording = d.str("__recording");
|
||||
// Which column records: the Hold column, or the Shortcut column.
|
||||
let recording_hold = !recording.is_empty() && d.bool("__recordingHold");
|
||||
// Record a chord (before widgets see the keys). Modifiers held down are part of the next key's
|
||||
// chord, not a chord of their own.
|
||||
if !recording.is_empty() {
|
||||
@@ -1706,7 +1910,11 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
if key == Key::Escape {
|
||||
d.fields.insert("__recording".into(), json!(""));
|
||||
} else if let Some(chord) = chord_from_event(key, m) {
|
||||
record(&mut d, km.to_mut(), &recording, &chord);
|
||||
if recording_hold {
|
||||
record_hold(&mut d, &mut holds, &recording, &chord);
|
||||
} else {
|
||||
record(&mut d, km.to_mut(), &recording, &chord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1728,6 +1936,8 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
&& let Some(p) = preset(name)
|
||||
{
|
||||
km.to_mut().set_overrides(p);
|
||||
// The presets have no hold shortcuts.
|
||||
holds.clear();
|
||||
d.fields.insert("set".into(), json!(name));
|
||||
d.fields.insert("__message".into(), json!(""));
|
||||
}
|
||||
@@ -1743,10 +1953,13 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
}
|
||||
if ui.button(tl!("Reset to Defaults")).clicked() {
|
||||
km.to_mut().reset_all();
|
||||
holds.clear();
|
||||
d.fields.insert("set".into(), json!(PRESETS[0]));
|
||||
d.fields.insert("__message".into(), json!(tl!("All shortcuts reset to defaults.")));
|
||||
}
|
||||
});
|
||||
ui.add_space(6.0);
|
||||
hold_row(ui, &t, &mut d);
|
||||
ui.add_space(8.0);
|
||||
// Tabs + search.
|
||||
ui.horizontal(|ui| {
|
||||
@@ -1769,14 +1982,25 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
let q = d.str("query").to_lowercase();
|
||||
let selected = d.str("__selected");
|
||||
let rec = d.str("__recording");
|
||||
let rec_hold = d.bool("__recordingHold");
|
||||
let holds_on = dialog_holds_on(&d);
|
||||
let scroll_to = d.fields.remove("__scrollTo").and_then(|v| v.as_str().map(str::to_string));
|
||||
egui::Frame::NONE.fill(t.input).stroke(egui::Stroke::new(1.0, t.input_border)).inner_margin(egui::Margin::same(4)).show(ui, |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
ui.allocate_ui_with_layout(egui::vec2(360.0, 16.0), egui::Layout::left_to_right(egui::Align::Center), |ui| {
|
||||
ui.set_min_width(360.0);
|
||||
let name_width = if holds_on { 340.0 } else { 360.0 };
|
||||
ui.allocate_ui_with_layout(egui::vec2(name_width, 16.0), egui::Layout::left_to_right(egui::Align::Center), |ui| {
|
||||
ui.set_min_width(name_width);
|
||||
ui.label(egui::RichText::new(if tools { tl!("Tool") } else { tl!("Command") }).color(t.text_dim).size(11.0));
|
||||
});
|
||||
ui.label(egui::RichText::new(tl!("Shortcut")).color(t.text_dim).size(11.0));
|
||||
if holds_on {
|
||||
ui.allocate_ui_with_layout(egui::vec2(150.0, 16.0), egui::Layout::left_to_right(egui::Align::Center), |ui| {
|
||||
ui.set_min_width(150.0);
|
||||
ui.label(egui::RichText::new(tl!("Shortcut")).color(t.text_dim).size(11.0));
|
||||
});
|
||||
ui.label(egui::RichText::new(tl!("Hold")).color(t.text_dim).size(11.0));
|
||||
} else {
|
||||
ui.label(egui::RichText::new(tl!("Shortcut")).color(t.text_dim).size(11.0));
|
||||
}
|
||||
});
|
||||
egui::ScrollArea::vertical().max_height(360.0).auto_shrink([false, false]).show(ui, |ui| {
|
||||
for (i, e) in view.entries.iter().enumerate().filter(|(_, e)| e.is_tool == tools && listed(km.overrides(), e)) {
|
||||
@@ -1784,28 +2008,50 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
Cow::Borrowed(_) => view.texts.get(i).cloned().flatten(),
|
||||
Cow::Owned(km) => dialog_shortcuts_with(km, &e.key, view.backtick.as_deref()),
|
||||
};
|
||||
if !q.is_empty() && !row_matches(e, &q, sc.as_deref()) {
|
||||
let hold_text = if holds_on { hold_of(&holds, &e.key).map(|h| menus::pretty_shortcut(&h)) } else { None };
|
||||
if !q.is_empty() && !row_matches(e, &q, sc.as_deref()) && !hold_text.is_some_and(|h| h.to_lowercase().contains(&q)) {
|
||||
continue;
|
||||
}
|
||||
let row = ui.horizontal(|ui| {
|
||||
let name = shown_name(e);
|
||||
let name_width = if holds_on { 340.0 } else { 360.0 };
|
||||
let r = ui
|
||||
.allocate_ui_with_layout(egui::vec2(360.0, 20.0), egui::Layout::left_to_right(egui::Align::Center), |ui| {
|
||||
ui.set_min_width(360.0);
|
||||
.allocate_ui_with_layout(egui::vec2(name_width, 20.0), egui::Layout::left_to_right(egui::Align::Center), |ui| {
|
||||
ui.set_min_width(name_width);
|
||||
ui.add(egui::Button::selectable(selected == e.key, egui::RichText::new(name).color(t.text)).truncate())
|
||||
})
|
||||
.inner;
|
||||
if r.clicked() {
|
||||
d.fields.insert("__selected".into(), json!(e.key));
|
||||
}
|
||||
let label = if rec == e.key { tl!("Press keys…").to_string() } else { sc.unwrap_or_else(|| "—".into()) };
|
||||
let recording_here = rec == e.key && !rec_hold;
|
||||
let label = if recording_here { tl!("Press keys…").to_string() } else { sc.unwrap_or_else(|| "—".into()) };
|
||||
let changed = crate::keymap::has_override(&saved, &e.key);
|
||||
let txt = egui::RichText::new(label).color(if changed { t.accent } else { t.text });
|
||||
let b = ui
|
||||
.add_sized([150.0, 20.0], egui::Button::new(txt).selected(rec == e.key))
|
||||
.add_sized([150.0, 20.0], egui::Button::new(txt).selected(recording_here))
|
||||
.on_hover_text(tl!("Click, then press the new shortcut (Esc cancels)"));
|
||||
if b.clicked() {
|
||||
d.fields.insert("__recording".into(), json!(e.key));
|
||||
d.fields.insert("__recordingHold".into(), json!(false));
|
||||
d.fields.insert("__selected".into(), json!(e.key));
|
||||
}
|
||||
if !holds_on {
|
||||
return;
|
||||
}
|
||||
let holding_here = rec == e.key && rec_hold;
|
||||
let hold = hold_of(&holds, &e.key);
|
||||
let label = if holding_here {
|
||||
tl!("Press keys…").to_string()
|
||||
} else {
|
||||
hold.as_deref().map_or_else(|| "—".into(), menus::pretty_shortcut)
|
||||
};
|
||||
let h = ui.add_sized([90.0, 20.0], egui::Button::new(egui::RichText::new(label).color(t.text)).selected(holding_here)).on_hover_text(
|
||||
tl!("Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut."),
|
||||
);
|
||||
if h.clicked() {
|
||||
d.fields.insert("__recording".into(), json!(e.key));
|
||||
d.fields.insert("__recordingHold".into(), json!(true));
|
||||
d.fields.insert("__selected".into(), json!(e.key));
|
||||
}
|
||||
});
|
||||
@@ -1829,6 +2075,10 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
if ui.button(tl!("Use Default")).clicked() {
|
||||
km.to_mut().reset(&command_of(&sel));
|
||||
}
|
||||
if dialog_holds_on(&d) && ui.add_enabled(holds.contains_key(&sel), egui::Button::new(tl!("Clear Hold"))).clicked() {
|
||||
holds.remove(&sel);
|
||||
d.fields.insert("set".into(), json!(CUSTOM));
|
||||
}
|
||||
});
|
||||
let conflict = d.str("__conflict");
|
||||
if !conflict.is_empty() && ui.button(tl!("Go to Conflict")).clicked() {
|
||||
@@ -1847,7 +2097,7 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
let n = match &km {
|
||||
Cow::Borrowed(_) => view.conflicts,
|
||||
Cow::Owned(km) => conflicts_in(km).len(),
|
||||
};
|
||||
} + if dialog_holds_on(&d) { hold_conflicts(&holds).len() } else { 0 };
|
||||
if n > 0 {
|
||||
ui.label(
|
||||
egui::RichText::new(crate::i18n::tn(
|
||||
@@ -1873,6 +2123,11 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
if let Cow::Owned(km) = &km {
|
||||
d.fields.insert("overrides".into(), stored::to_value(&saved_overrides(km.overrides(), &saved)));
|
||||
}
|
||||
drop_unlisted_holds(&mut holds, km.overrides());
|
||||
d.fields.insert("holds".into(), json!(holds));
|
||||
if d.str("__recording").is_empty() {
|
||||
d.fields.insert("__recordingHold".into(), json!(false));
|
||||
}
|
||||
let import = d.fields.remove("__import").is_some();
|
||||
let export = d.fields.remove("__export").is_some();
|
||||
let export_text = d.fields.remove("__exportText").is_some();
|
||||
@@ -1907,14 +2162,15 @@ fn import_into_dialog(app: &mut VectorcraftApp) {
|
||||
app.status(crate::picks::dialog_gone());
|
||||
return;
|
||||
}
|
||||
let saved = (app.ui.shortcut_overrides.clone(), app.ui.shortcut_set.clone());
|
||||
let saved = (app.ui.shortcut_overrides.clone(), app.ui.shortcut_holds.clone(), app.ui.shortcut_set.clone());
|
||||
match run_command(app, "shortcuts.import", &json!({})) {
|
||||
Some(Ok(_)) => {
|
||||
let (o, s) = (app.ui.shortcut_overrides.clone(), app.ui.shortcut_set.clone());
|
||||
(app.ui.shortcut_overrides, app.ui.shortcut_set) = saved;
|
||||
let (o, h, s) = (app.ui.shortcut_overrides.clone(), app.ui.shortcut_holds.clone(), app.ui.shortcut_set.clone());
|
||||
(app.ui.shortcut_overrides, app.ui.shortcut_holds, app.ui.shortcut_set) = saved;
|
||||
sync(&app.ui);
|
||||
if let Some(d) = app.ui.dialog.as_mut().filter(|d| d.kind == "shortcuts") {
|
||||
d.fields.insert("overrides".into(), stored::to_value(&o));
|
||||
d.fields.insert("holds".into(), json!(h));
|
||||
d.fields.insert("set".into(), json!(s));
|
||||
d.fields.insert("__message".into(), json!(tl!("Imported. Press OK to keep the imported set.")));
|
||||
}
|
||||
@@ -1940,13 +2196,19 @@ fn export_dialog_set(app: &mut VectorcraftApp, command: &str) {
|
||||
app.status(crate::picks::dialog_gone());
|
||||
return;
|
||||
}
|
||||
let (ov, set) = app.ui.dialog.as_ref().map(|d| (dialog_overrides(d), d.str("set"))).unwrap_or_default();
|
||||
let (ov, holds, set, on) =
|
||||
app.ui.dialog.as_ref().map(|d| (dialog_overrides(d), dialog_holds(d), d.str("set"), dialog_holds_on(d))).unwrap_or_default();
|
||||
let saved = std::mem::replace(&mut app.ui.shortcut_overrides, ov);
|
||||
let saved_holds = std::mem::replace(&mut app.ui.shortcut_holds, holds);
|
||||
let saved_set = std::mem::replace(&mut app.ui.shortcut_set, set);
|
||||
// Export Text… lists the hold shortcuts while the dialog's Hold Shortcuts is on.
|
||||
let saved_on = std::mem::replace(&mut app.session.prefs.hold_shortcuts, on);
|
||||
if let Some(Err(e)) = run_command(app, command, &json!({})) {
|
||||
app.status(e);
|
||||
}
|
||||
app.session.prefs.hold_shortcuts = saved_on;
|
||||
app.ui.shortcut_overrides = saved;
|
||||
app.ui.shortcut_holds = saved_holds;
|
||||
app.ui.shortcut_set = saved_set;
|
||||
}
|
||||
|
||||
@@ -2004,6 +2266,107 @@ fn record(d: &mut Dialog, km: &mut Keymap, key: &str, chord: &str) {
|
||||
}
|
||||
}
|
||||
|
||||
/// The Hold Shortcuts row of the Keyboard Shortcuts dialog: the checkbox that turns hold shortcuts
|
||||
/// on (and shows the Hold column), a button that shows how they work, and, while on, the Hold
|
||||
/// Shortcut Delay.
|
||||
fn hold_row(ui: &mut egui::Ui, t: &Tokens, d: &mut Dialog) {
|
||||
ui.horizontal(|ui| {
|
||||
let mut on = dialog_holds_on(d);
|
||||
if ui.checkbox(&mut on, egui::RichText::new(tl!("Hold Shortcuts")).color(t.text)).changed() {
|
||||
d.fields.insert("holdShortcuts".into(), json!(on));
|
||||
if !on && d.bool("__recordingHold") {
|
||||
d.fields.insert("__recording".into(), json!(""));
|
||||
d.fields.insert("__recordingHold".into(), json!(false));
|
||||
}
|
||||
}
|
||||
let info = d.bool("__holdInfo");
|
||||
if ui
|
||||
.add(egui::Button::new(egui::RichText::new("?").color(t.text_dim)).selected(info).small())
|
||||
.on_hover_text(tl!("How hold shortcuts work"))
|
||||
.clicked()
|
||||
{
|
||||
d.fields.insert("__holdInfo".into(), json!(!info));
|
||||
}
|
||||
if on {
|
||||
ui.add_space(12.0);
|
||||
ui.label(egui::RichText::new(tl!("Hold Shortcut Delay")).color(t.text_dim));
|
||||
let (min, max) = vectorcraft_engine::KEY_HOLD_DELAY_RANGE;
|
||||
let mut delay = dialog_hold_delay(d);
|
||||
if ui.add(egui::DragValue::new(&mut delay).range(min..=max).speed(0.01).fixed_decimals(2).suffix(" s")).changed() {
|
||||
d.fields.insert("keyHoldDelay".into(), json!(delay));
|
||||
}
|
||||
}
|
||||
});
|
||||
if d.bool("__holdInfo") {
|
||||
egui::Frame::NONE.stroke(egui::Stroke::new(1.0, t.input_border)).inner_margin(egui::Margin::same(8)).show(ui, |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
hold_illustration(ui, t);
|
||||
ui.add_space(8.0);
|
||||
ui.add(
|
||||
egui::Label::new(
|
||||
egui::RichText::new(tl!(
|
||||
"A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift."
|
||||
))
|
||||
.color(t.text)
|
||||
.size(11.5),
|
||||
)
|
||||
.wrap(),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// A key and two presses of it drawn in code: a short press (Tap) ends before the delay, and a long
|
||||
/// one (Hold) reaches it.
|
||||
fn hold_illustration(ui: &mut egui::Ui, t: &Tokens) {
|
||||
let (rect, _) = ui.allocate_exact_size(egui::vec2(200.0, 52.0), egui::Sense::hover());
|
||||
let p = ui.painter_at(rect);
|
||||
let key = egui::Rect::from_min_size(rect.min + egui::vec2(2.0, 12.0), egui::vec2(28.0, 28.0));
|
||||
p.rect(key, 4.0, t.input, egui::Stroke::new(1.0, t.input_border), egui::StrokeKind::Inside);
|
||||
p.text(key.center(), egui::Align2::CENTER_CENTER, "X", egui::FontId::proportional(13.0), t.text);
|
||||
let start = key.right() + 10.0;
|
||||
let delay_x = start + 70.0;
|
||||
let rows = [(tl!("Tap"), 40.0, key.top() + 6.0), (tl!("Hold"), 100.0, key.bottom() - 6.0)];
|
||||
for (label, len, y) in rows {
|
||||
let color = if start + len >= delay_x { t.accent } else { t.text_dim };
|
||||
p.line_segment([egui::pos2(start, y), egui::pos2(start + len, y)], egui::Stroke::new(4.0, color));
|
||||
p.text(egui::pos2(start + len + 4.0, y), egui::Align2::LEFT_CENTER, label, egui::FontId::proportional(10.5), t.text);
|
||||
}
|
||||
// The delay.
|
||||
let mut y = rect.top() + 4.0;
|
||||
while y < rect.bottom() - 4.0 {
|
||||
p.line_segment([egui::pos2(delay_x, y), egui::pos2(delay_x, (y + 3.0).min(rect.bottom() - 4.0))], egui::Stroke::new(1.0, t.text_dim));
|
||||
y += 6.0;
|
||||
}
|
||||
}
|
||||
|
||||
/// Apply a recorded key as `key`'s hold shortcut in the working set. Another entry that held the
|
||||
/// key loses it, with the same warning as a shortcut; a key that can't hold says why.
|
||||
fn record_hold(d: &mut Dialog, holds: &mut Holds, key: &str, chord: &str) {
|
||||
d.fields.insert("__recording".into(), json!(""));
|
||||
d.fields.insert("__recordingHold".into(), json!(false));
|
||||
match assign_hold(holds, key, Some(chord), true) {
|
||||
Ok(removed) => {
|
||||
d.fields.insert("set".into(), json!(CUSTOM));
|
||||
let names: Vec<String> = removed.iter().map(|k| entry(k).map(|e| shown_name(&e)).unwrap_or(k.clone())).collect();
|
||||
let message = if names.is_empty() {
|
||||
String::new()
|
||||
} else {
|
||||
crate::i18n::fmt(
|
||||
tl!("⚠ {chord} was already used by {names} — it has been removed there."),
|
||||
&[("chord", &menus::pretty_shortcut(chord)), ("names", &names.join(", "))],
|
||||
)
|
||||
};
|
||||
d.fields.insert("__message".into(), json!(message));
|
||||
d.fields.insert("__conflict".into(), json!(""));
|
||||
}
|
||||
Err(e) => {
|
||||
d.fields.insert("__message".into(), json!(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
@@ -2413,7 +2776,7 @@ mod tests {
|
||||
tops.push(top);
|
||||
}
|
||||
}
|
||||
(export_sections(&ov), listed.len(), tops)
|
||||
(export_sections(&ov, &Holds::new()), listed.len(), tops)
|
||||
});
|
||||
let titles: Vec<&str> = sections.iter().map(|s| s.title.as_str()).collect();
|
||||
assert_eq!(titles[0], "Tools");
|
||||
@@ -2488,7 +2851,7 @@ mod tests {
|
||||
Ok(())
|
||||
}));
|
||||
app.run("shortcuts.exportText", json!({"path": "/a/list.csv", "format": "csv"})).unwrap();
|
||||
(returned, written.borrow().clone(), export_sections(&app.ui.shortcut_overrides))
|
||||
(returned, written.borrow().clone(), export_sections(&app.ui.shortcut_overrides, &Holds::new()))
|
||||
});
|
||||
let [(path, bytes)] = files.as_slice() else { panic!("{} files", files.len()) };
|
||||
assert_eq!(path, "/a/list.csv");
|
||||
@@ -3250,6 +3613,254 @@ mod tests {
|
||||
assert!(app.run("shortcuts.preset", json!({"name": null})).unwrap_err().starts_with("unknown preset"));
|
||||
}
|
||||
|
||||
/// `shortcuts.set {hold}` gives an entry a hold shortcut and leaves its shortcut, its default
|
||||
/// and its overridden state alone; `shortcuts.list` shows it; Clear (`shortcut: null`) keeps it.
|
||||
#[test]
|
||||
fn a_hold_shortcut_is_kept_apart_from_the_shortcut() {
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
|
||||
let before = effective_in(&app.ui.shortcut_overrides, "paint.swap");
|
||||
let r = app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "x"})).unwrap();
|
||||
assert_eq!((r["hold"].as_str(), r["shortcut"].as_str().map(str::to_string)), (Some("X"), before.clone()));
|
||||
assert!(app.ui.shortcut_overrides.is_empty(), "no shortcut changed");
|
||||
assert_eq!(app.ui.shortcut_set, CUSTOM);
|
||||
let rows = with_steady_plugins(|| app.run("shortcuts.list", json!({"query": "paint.swap"})).unwrap());
|
||||
let row = rows.as_array().unwrap().iter().find(|r| r["id"] == "paint.swap").unwrap().clone();
|
||||
assert_eq!((row["hold"].as_str(), row["overridden"].as_bool()), (Some("X"), Some(false)));
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "shortcut": null})).unwrap();
|
||||
assert_eq!(hold_of(&app.ui.shortcut_holds, "paint.swap").as_deref(), Some("X"), "Use Default keeps the hold");
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "shortcut": "Cmd+Alt+Shift+F9"})).unwrap();
|
||||
assert_eq!(hold_of(&app.ui.shortcut_holds, "paint.swap").as_deref(), Some("X"), "a new shortcut keeps the hold");
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": ""})).unwrap();
|
||||
assert!(app.ui.shortcut_holds.is_empty(), "an empty hold removes it");
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Shift+1"})).unwrap();
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": null})).unwrap();
|
||||
assert!(app.ui.shortcut_holds.is_empty(), "a null hold removes it");
|
||||
}
|
||||
|
||||
/// A hold shortcut is a key that types a character, alone or with Shift; other keys, a clash
|
||||
/// without `force` and a hold that is not a string are refused and change nothing.
|
||||
#[test]
|
||||
fn hold_shortcuts_refuse_keys_that_cannot_wait() {
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
|
||||
for bad in ["Space", "Shift+Space", "~", "Shift+~", "Cmd+X", "Alt+X", "Ctrl+X", "Left", "F5", "Enter", "Delete"] {
|
||||
let r = app.run("shortcuts.set", json!({"id": "paint.swap", "hold": bad}));
|
||||
assert!(r.is_err(), "{bad}: {r:?}");
|
||||
}
|
||||
assert_eq!(app.run("shortcuts.set", json!({"id": "paint.swap", "hold": 5})), Err("`hold` must be a string".to_string()));
|
||||
assert!(app.ui.shortcut_holds.is_empty());
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Shift+X"})).unwrap();
|
||||
let clash = app.run("shortcuts.set", json!({"id": "select.none", "hold": "Shift+X"})).unwrap_err();
|
||||
assert!(clash.starts_with("Hold "), "{clash}");
|
||||
// A refused hold leaves the shortcut given with it unchanged too.
|
||||
let r = app.run("shortcuts.set", json!({"id": "select.none", "shortcut": "Cmd+Alt+Shift+F9", "hold": "Shift+X"}));
|
||||
assert!(r.is_err());
|
||||
assert!(app.ui.shortcut_overrides.is_empty());
|
||||
let r = app.run("shortcuts.set", json!({"id": "select.none", "hold": "Shift+X", "force": true})).unwrap();
|
||||
assert_eq!(r["removedFrom"], json!(["paint.swap"]));
|
||||
assert_eq!(app.ui.shortcut_holds.keys().collect::<Vec<_>>(), ["select.none"]);
|
||||
}
|
||||
|
||||
/// A command the editor lists only with a shortcut (Transparency needs a value) takes a hold
|
||||
/// shortcut only with one, and loses its hold, as it stops being listed, when the shortcut is
|
||||
/// taken away: by clearing it or by giving it to another command.
|
||||
#[test]
|
||||
fn a_hold_shortcut_needs_a_listed_entry() {
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
|
||||
assert!(needs_a_value("transparency.set"));
|
||||
let r = app.run("shortcuts.set", json!({"id": "transparency.set", "hold": "Q"}));
|
||||
assert!(r.is_err(), "{r:?}");
|
||||
assert!(app.ui.shortcut_holds.is_empty() && app.ui.shortcut_overrides.is_empty());
|
||||
let q = vc_chord("Q").unwrap();
|
||||
app.run("shortcuts.set", json!({"id": "transparency.set", "shortcut": "Cmd+Alt+Shift+F9", "hold": "Q"})).unwrap();
|
||||
assert_eq!(hold_for(&app.ui.shortcut_holds, &q), Some("transparency.set"));
|
||||
let rows = with_steady_plugins(|| app.run("shortcuts.list", json!({"query": "transparency.set"})).unwrap());
|
||||
assert!(rows.as_array().unwrap().iter().any(|r| r["id"] == "transparency.set" && r["hold"] == "Q"), "{rows}");
|
||||
app.run("shortcuts.set", json!({"id": "transparency.set", "shortcut": ""})).unwrap();
|
||||
assert_eq!(hold_for(&app.ui.shortcut_holds, &q), None);
|
||||
assert!(app.ui.shortcut_holds.is_empty(), "{:?}", app.ui.shortcut_holds);
|
||||
// The key is free for another command, with no conflict left behind.
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Q"})).unwrap();
|
||||
assert_eq!(app.run("shortcuts.conflicts", json!({})).unwrap(), json!([]));
|
||||
app.run("shortcuts.set", json!({"id": "transparency.set", "shortcut": "Cmd+Alt+Shift+F9", "hold": "Shift+Q"})).unwrap();
|
||||
app.run("shortcuts.set", json!({"id": "edit.duplicate", "shortcut": "Cmd+Alt+Shift+F9", "force": true})).unwrap();
|
||||
assert_eq!(app.ui.shortcut_holds.keys().collect::<Vec<_>>(), ["paint.swap"]);
|
||||
}
|
||||
|
||||
/// Reset All and a preset clear the hold shortcuts; two entries holding one key are a conflict.
|
||||
#[test]
|
||||
fn hold_shortcut_conflicts_reset_and_presets() {
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
|
||||
app.ui.shortcut_holds.insert("paint.swap".into(), "X".into());
|
||||
app.ui.shortcut_holds.insert("select.none".into(), "X".into());
|
||||
let c = app.run("shortcuts.conflicts", json!({})).unwrap();
|
||||
assert!(c.as_array().unwrap().iter().any(|c| c["shortcut"] == "Hold X"), "{c}");
|
||||
app.run("shortcuts.reset", json!({})).unwrap();
|
||||
assert!(app.ui.shortcut_holds.is_empty());
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "X"})).unwrap();
|
||||
app.run("shortcuts.preset", json!({"name": PRESETS[0]})).unwrap();
|
||||
assert!(app.ui.shortcut_holds.is_empty());
|
||||
}
|
||||
|
||||
/// Export… writes the hold shortcuts as `holds` (version 1) only when there are any; Import…
|
||||
/// reads them, a file without them has none, and a bad one fails and applies nothing.
|
||||
#[test]
|
||||
fn hold_shortcuts_export_and_import() {
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
|
||||
let none = export_json("Studio", &Overrides::new());
|
||||
assert!(none.get("holds").is_none());
|
||||
let holds: Holds = [("paint.swap".to_string(), "X".to_string())].into();
|
||||
let v = export_json_with("Studio", &Overrides::new(), &holds);
|
||||
assert_eq!((v["version"].as_u64(), v["holds"].clone()), (Some(1), json!({"paint.swap": "X"})));
|
||||
app.run("shortcuts.import", json!({"data": v})).unwrap();
|
||||
assert_eq!(app.ui.shortcut_holds, holds);
|
||||
for bad in [json!("X"), json!({"paint.swap": 5}), json!({"paint.swap": "Space"})] {
|
||||
let mut v = export_json("Other", &Overrides::new());
|
||||
v["holds"] = bad.clone();
|
||||
assert!(app.run("shortcuts.import", json!({"data": v})).is_err(), "{bad}");
|
||||
assert_eq!((app.ui.shortcut_holds.clone(), app.ui.shortcut_set.as_str()), (holds.clone(), "Studio"), "{bad}");
|
||||
}
|
||||
app.run("shortcuts.import", json!({"data": none})).unwrap();
|
||||
assert!(app.ui.shortcut_holds.is_empty(), "an import replaces the whole set");
|
||||
}
|
||||
|
||||
/// Export Text… gives a row with a hold shortcut a third column while Hold Shortcuts is on.
|
||||
#[test]
|
||||
fn export_text_lists_hold_shortcuts_while_they_act() {
|
||||
type Files = std::rc::Rc<std::cell::RefCell<Vec<String>>>;
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
|
||||
let written: Files = Default::default();
|
||||
let w = written.clone();
|
||||
app.services.write = Some(Box::new(move |_: &str, b: &[u8]| {
|
||||
w.borrow_mut().push(String::from_utf8(b.to_vec()).map_err(|e| e.to_string())?);
|
||||
Ok(())
|
||||
}));
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "X"})).unwrap();
|
||||
let row = |text: &str| text.lines().find(|l| l.starts_with(&english_name(&entry("paint.swap").unwrap()))).map(str::to_string);
|
||||
with_steady_plugins(|| {
|
||||
written.borrow_mut().clear();
|
||||
app.run("shortcuts.exportText", json!({"path": "/a.txt"})).unwrap();
|
||||
app.run("prefs.set", json!({"key": "holdShortcuts", "value": true})).unwrap();
|
||||
app.run("shortcuts.exportText", json!({"path": "/b.txt"})).unwrap();
|
||||
app.run("prefs.set", json!({"key": "holdShortcuts", "value": false})).unwrap();
|
||||
});
|
||||
let files = written.borrow();
|
||||
let (off, on) = (row(&files[0]).unwrap(), row(&files[1]).unwrap());
|
||||
assert_eq!(off.split('\t').count(), 2, "{off}");
|
||||
assert_eq!(on.split('\t').nth(2), Some(format!("Hold {}", menus::pretty_shortcut("X")).as_str()), "{on}");
|
||||
}
|
||||
|
||||
/// Export Text…'s shortcut sheet and CSV file also list a hold shortcut while Hold Shortcuts is
|
||||
/// on, after the row's shortcuts.
|
||||
#[test]
|
||||
fn the_sheet_and_csv_list_hold_shortcuts_while_they_act() {
|
||||
type Files = std::rc::Rc<std::cell::RefCell<Vec<Vec<u8>>>>;
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
|
||||
let written: Files = Default::default();
|
||||
let w = written.clone();
|
||||
app.services.write = Some(Box::new(move |_: &str, b: &[u8]| {
|
||||
w.borrow_mut().push(b.to_vec());
|
||||
Ok(())
|
||||
}));
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "X"})).unwrap();
|
||||
let hold = format!("Hold {}", menus::pretty_shortcut("X"));
|
||||
let sections = with_steady_plugins(|| {
|
||||
written.borrow_mut().clear();
|
||||
for on in [false, false, true] {
|
||||
app.run("prefs.set", json!({"key": "holdShortcuts", "value": on})).unwrap();
|
||||
app.run("shortcuts.exportText", json!({"path": "/a.csv", "format": "csv"})).unwrap();
|
||||
app.run("shortcuts.exportText", json!({"path": "/a.pdf", "format": "sheet"})).unwrap();
|
||||
}
|
||||
app.run("prefs.set", json!({"key": "holdShortcuts", "value": false})).unwrap();
|
||||
export_sections(&app.ui.shortcut_overrides, &app.ui.shortcut_holds)
|
||||
});
|
||||
let files = written.borrow();
|
||||
let [csv_off, sheet_off, _, sheet_off_again, csv_on, sheet_on] = files.as_slice() else { panic!("{} files", files.len()) };
|
||||
let swap = sections.iter().flat_map(|s| &s.rows).filter(|r| r.shortcut.ends_with(&hold)).collect::<Vec<_>>();
|
||||
assert_eq!(swap.len(), 1, "one row has the hold: {swap:?}");
|
||||
let (csv_off, csv_on) = (String::from_utf8_lossy(csv_off), String::from_utf8_lossy(csv_on));
|
||||
assert!(!csv_off.contains(&hold), "off, the CSV file lists no hold");
|
||||
assert!(csv_on.contains(&swap[0].shortcut), "on, the CSV file lists it: {}", swap[0].shortcut);
|
||||
assert_eq!(sheet_off, sheet_off_again, "the sheet is the same each time");
|
||||
assert_ne!(sheet_off, sheet_on, "on, the sheet lists the hold");
|
||||
}
|
||||
|
||||
/// The text the Keyboard Shortcuts dialog draws in its second frame.
|
||||
fn dialog_texts(app: &mut VectorcraftApp) -> Vec<String> {
|
||||
let ctx = egui::Context::default();
|
||||
theme::install_fonts(&ctx);
|
||||
// The modal draws nothing in its first frame, which only sizes it.
|
||||
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| show(app, ui.ctx()));
|
||||
out.textures_delta.clear();
|
||||
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| show(app, ui.ctx()));
|
||||
out.textures_delta.clear();
|
||||
out.shapes
|
||||
.iter()
|
||||
.filter_map(|c| match &c.shape {
|
||||
egui::Shape::Text(t) => Some(t.galley.text().to_string()),
|
||||
_ => None,
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Hold Shortcuts is off by default: the dialog shows its checkbox and no Hold column. Turned
|
||||
/// on, the dialog shows the column and the delay, and OK turns hold shortcuts on and asks the
|
||||
/// host to write the preferences file; Cancel keeps them off.
|
||||
#[test]
|
||||
fn the_hold_shortcuts_checkbox_shows_the_hold_column() {
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
|
||||
assert!(!app.session.prefs.hold_shortcuts);
|
||||
open(&mut app);
|
||||
let off = dialog_texts(&mut app);
|
||||
assert!(off.iter().any(|t| t == "Hold Shortcuts"), "{off:?}");
|
||||
assert!(!off.iter().any(|t| t == "Hold" || t == "Hold Shortcut Delay"), "{off:?}");
|
||||
app.ui.dialog.as_mut().unwrap().fields.insert("holdShortcuts".into(), json!(true));
|
||||
let on = dialog_texts(&mut app);
|
||||
assert!(on.iter().any(|t| t == "Hold") && on.iter().any(|t| t == "Hold Shortcut Delay"), "{on:?}");
|
||||
app.ui.dialog = None;
|
||||
assert!(!app.session.prefs.hold_shortcuts, "Cancel keeps them off");
|
||||
assert!(!app.take_prefs_changed(), "nothing to write after Cancel");
|
||||
open(&mut app);
|
||||
let d = app.ui.dialog.as_mut().unwrap();
|
||||
d.fields.insert("holdShortcuts".into(), json!(true));
|
||||
d.fields.insert("keyHoldDelay".into(), json!(0.5));
|
||||
confirm(&mut app).unwrap();
|
||||
assert!(app.session.prefs.hold_shortcuts);
|
||||
assert_eq!(app.session.prefs.key_hold_delay, 0.5);
|
||||
assert!(app.take_prefs_changed(), "OK asks the host to write the preferences file");
|
||||
assert_eq!(app.ui.engine_prefs["holdShortcuts"], json!(true));
|
||||
assert_eq!(app.ui.engine_prefs["keyHoldDelay"], json!(0.5));
|
||||
}
|
||||
|
||||
/// The info button shows how hold shortcuts work.
|
||||
#[test]
|
||||
fn the_info_button_explains_hold_shortcuts() {
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
|
||||
open(&mut app);
|
||||
assert!(!dialog_texts(&mut app).iter().any(|t| t.starts_with("A quick press")));
|
||||
app.ui.dialog.as_mut().unwrap().fields.insert("__holdInfo".into(), json!(true));
|
||||
let texts = dialog_texts(&mut app);
|
||||
assert!(texts.iter().any(|t| t.starts_with("A quick press")) && texts.iter().any(|t| t == "Tap"), "{texts:?}");
|
||||
}
|
||||
|
||||
/// While Hold Shortcuts is on, the search finds a row by its hold shortcut as the Hold column
|
||||
/// shows it; while it is off, the hold shortcut finds nothing.
|
||||
#[test]
|
||||
fn the_search_finds_a_row_by_its_hold_shortcut() {
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Shift+;"})).unwrap();
|
||||
let hold = menus::pretty_shortcut("Shift+;").to_lowercase();
|
||||
let name = shown_name(&entry("paint.swap").unwrap());
|
||||
assert!(!name.to_lowercase().contains(&hold), "{name}");
|
||||
open(&mut app);
|
||||
let d = app.ui.dialog.as_mut().unwrap();
|
||||
d.fields.insert("tab".into(), json!("menu"));
|
||||
d.fields.insert("query".into(), json!(hold));
|
||||
assert!(!dialog_texts(&mut app).contains(&name), "off, the hold shortcut finds nothing");
|
||||
app.ui.dialog.as_mut().unwrap().fields.insert("holdShortcuts".into(), json!(true));
|
||||
let texts = dialog_texts(&mut app);
|
||||
assert!(texts.contains(&name), "{name} in {texts:?}");
|
||||
}
|
||||
|
||||
/// A command that needs a value is listed in the editor once the user gives it a key, but the
|
||||
/// command search still leaves it out: a pick gives it no value.
|
||||
#[test]
|
||||
|
||||
@@ -12,11 +12,13 @@ use vectorcraft_tools::{Mods, SurroundingUnit, ToolKey};
|
||||
use crate::VectorcraftApp;
|
||||
|
||||
mod held_tool;
|
||||
mod hold_keys;
|
||||
mod paste;
|
||||
mod presentation;
|
||||
mod typing;
|
||||
|
||||
pub(crate) use held_tool::{HeldTool, note_tool_use};
|
||||
pub(crate) use hold_keys::HoldKeys;
|
||||
use paste::unclip_chords;
|
||||
pub(crate) use paste::{PasteChord, paste_command};
|
||||
pub(crate) use presentation::presentation_step;
|
||||
@@ -196,6 +198,8 @@ pub fn handle(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
note_key_surfaces(app, ctx);
|
||||
forget_opening_key(ctx);
|
||||
let focused = ctx.input(|input| input.focused) || app.forwarded_frame && ctx.viewport_id() == egui::ViewportId::ROOT;
|
||||
// The repeats of a key with a hold shortcut stay out of every frame until it is let go.
|
||||
hold_keys::guard(app, ctx, focused);
|
||||
// A held tool shortcut that is let go returns to the tool active before it.
|
||||
held_tool::follow(app, ctx, focused);
|
||||
if !focused {
|
||||
@@ -251,6 +255,11 @@ pub fn handle(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
presentation_keys(app, ctx);
|
||||
return;
|
||||
}
|
||||
// Keys with a hold shortcut wait before anything else reads the frame's keys, so a key pressed
|
||||
// after one acts after it.
|
||||
if hold_keys::intake(app, ctx) {
|
||||
return;
|
||||
}
|
||||
// Escape that cancels a ruler-origin drag or floating Tools move skips the tool and later Escape actions,
|
||||
// and so do its repeats while it is held.
|
||||
let escape_ended_gesture = escape_ended_gesture(ctx);
|
||||
@@ -595,42 +604,60 @@ fn single_key_shortcuts(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
})
|
||||
.collect()
|
||||
});
|
||||
let keymap = crate::shortcut_editor::current();
|
||||
for (text, m, pressed, repeat) in events {
|
||||
if m.command || m.alt || m.ctrl {
|
||||
continue;
|
||||
}
|
||||
let upper = text.to_uppercase();
|
||||
let key = if m.shift && text.chars().all(|c| c.is_alphabetic()) { format!("Shift+{upper}") } else { upper.clone() };
|
||||
// A shifted punctuation character can also be written with its Shift (the Curvature tool's
|
||||
// Shift+~ arrives as `~`).
|
||||
let shifted = m.shift.then(|| format!("Shift+{text}"));
|
||||
let mut chords: Vec<craft_keymap::Chord> =
|
||||
[Some(key), Some(text), shifted].into_iter().flatten().filter_map(|t| crate::keymap::vc_chord(&t)).collect();
|
||||
// A character no chord names (`"`, which the backtick key types on Turkish Q) is read as
|
||||
// the key that typed it, as the Keyboard Shortcuts editor records that press.
|
||||
if chords.is_empty() {
|
||||
let typed_by = pressed.and_then(|k| crate::shortcut_editor::chord_from_event(k, Modifiers { shift: m.shift, ..Modifiers::NONE }));
|
||||
chords.extend(typed_by.and_then(|t| crate::keymap::vc_chord(&t)));
|
||||
let chords = text_chords(&text, m, pressed);
|
||||
if run_single_key(app, ctx, &chords, pressed, repeat) {
|
||||
break;
|
||||
}
|
||||
let hits: Vec<CommandRef> = chords.iter().filter_map(|c| crate::keymap::lookup(&keymap.keymap, c)).collect();
|
||||
// Single-key command shortcuts (X, Shift+X, D, /, Shift+D, F, Shift+F by default) before
|
||||
// tools.
|
||||
let Some(hit) = hits.iter().find(|c| !c.id.starts_with("tool:")).or(hits.first()) else { continue };
|
||||
// A command runs as it does on a chord ([`run_hit`]): what its menu item runs. Smooth opens
|
||||
// its slider, and Move opens its dialog.
|
||||
match hit.id.strip_prefix("tool:") {
|
||||
Some(tool) => held_tool::choose(app, ctx, tool, pressed, repeat),
|
||||
None => {
|
||||
run_hit(app, ctx, hit);
|
||||
if dialog_or_palette_open(app) {
|
||||
if let Some(key) = pressed {
|
||||
let id = opening_key_id(ctx);
|
||||
ctx.data_mut(|m| m.insert_temp(id, key));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The chords a single-key shortcut reads for `text`, typed with `m` by the key `pressed`.
|
||||
fn text_chords(text: &str, m: Modifiers, pressed: Option<Key>) -> Vec<craft_keymap::Chord> {
|
||||
let upper = text.to_uppercase();
|
||||
let key = if m.shift && text.chars().all(|c| c.is_alphabetic()) { format!("Shift+{upper}") } else { upper.clone() };
|
||||
// A shifted punctuation character can also be written with its Shift (the Curvature tool's
|
||||
// Shift+~ arrives as `~`).
|
||||
let shifted = m.shift.then(|| format!("Shift+{text}"));
|
||||
let mut chords: Vec<craft_keymap::Chord> =
|
||||
[Some(key), Some(text.to_string()), shifted].into_iter().flatten().filter_map(|t| crate::keymap::vc_chord(&t)).collect();
|
||||
// A character no chord names (`"`, which the backtick key types on Turkish Q) is read as
|
||||
// the key that typed it, as the Keyboard Shortcuts editor records that press.
|
||||
if chords.is_empty() {
|
||||
let typed_by = pressed.and_then(|k| crate::shortcut_editor::chord_from_event(k, Modifiers { shift: m.shift, ..Modifiers::NONE }));
|
||||
chords.extend(typed_by.and_then(|t| crate::keymap::vc_chord(&t)));
|
||||
}
|
||||
chords
|
||||
}
|
||||
|
||||
/// Runs the single-key shortcut of `chords`, typed by the key `pressed`. True when it opened a
|
||||
/// dialog or the palette: the shortcuts after it in the frame do not run.
|
||||
fn run_single_key(app: &mut VectorcraftApp, ctx: &egui::Context, chords: &[craft_keymap::Chord], pressed: Option<Key>, repeat: bool) -> bool {
|
||||
let keymap = crate::shortcut_editor::current();
|
||||
let hits: Vec<CommandRef> = chords.iter().filter_map(|c| crate::keymap::lookup(&keymap.keymap, c)).collect();
|
||||
// Single-key command shortcuts (X, Shift+X, D, /, Shift+D, F, Shift+F by default) before
|
||||
// tools.
|
||||
let Some(hit) = hits.iter().find(|c| !c.id.starts_with("tool:")).or(hits.first()) else { return false };
|
||||
// A command runs as it does on a chord ([`run_hit`]): what its menu item runs. Smooth opens
|
||||
// its slider, and Move opens its dialog.
|
||||
match hit.id.strip_prefix("tool:") {
|
||||
Some(tool) => {
|
||||
held_tool::choose(app, ctx, tool, pressed, repeat);
|
||||
false
|
||||
}
|
||||
None => {
|
||||
run_hit(app, ctx, hit);
|
||||
if !dialog_or_palette_open(app) {
|
||||
return false;
|
||||
}
|
||||
if let Some(key) = pressed {
|
||||
let id = opening_key_id(ctx);
|
||||
ctx.data_mut(|m| m.insert_temp(id, key));
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1092,7 +1119,7 @@ fn run_hit(app: &mut VectorcraftApp, ctx: &egui::Context, c: &CommandRef) {
|
||||
}
|
||||
|
||||
/// Keys that type a character: letters, digits and punctuation (not Space).
|
||||
fn types_text(key: craft_keymap::Key) -> bool {
|
||||
pub(crate) fn types_text(key: craft_keymap::Key) -> bool {
|
||||
key.name().chars().count() == 1
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,426 @@
|
||||
//! Hold shortcuts (Edit › Keyboard Shortcuts, Hold Shortcuts on, the Hold column): a character key
|
||||
//! with a hold shortcut waits when it goes down. Held for the Hold Shortcut Delay (`keyHoldDelay`),
|
||||
//! it runs its hold shortcut once, and its repeats are ignored until it is let go. Let go sooner, it
|
||||
//! runs what a press of the key runs without a hold shortcut, at the release. A key without a hold
|
||||
//! shortcut runs on its press, as before, and so does every key while Hold Shortcuts is off.
|
||||
|
||||
use super::{Key, Modifiers, VectorcraftApp};
|
||||
use vectorcraft_tools::ToolKey;
|
||||
|
||||
/// A press of a key with a hold shortcut, waiting for its release or for the delay to pass.
|
||||
pub(crate) struct Pending {
|
||||
/// The entry the hold shortcut runs (`tool:<id>`, a command id or `panel:<id>`).
|
||||
entry: String,
|
||||
/// The chords the press names, first match first, for the tap.
|
||||
chords: Vec<craft_keymap::Chord>,
|
||||
/// The key as egui reported the press, before any rewrite of the dispatcher.
|
||||
key: Key,
|
||||
/// The key's position, when the press gave one.
|
||||
physical: Option<Key>,
|
||||
/// The modifiers held at the press.
|
||||
mods: Modifiers,
|
||||
/// When the key went down (`egui::InputState::time`).
|
||||
since: f64,
|
||||
/// The Hold Shortcut Delay read at the press: a later change does not move this wait.
|
||||
delay: f64,
|
||||
/// The viewport whose frame saw the press. Frames of other viewports leave the wait alone.
|
||||
viewport: egui::ViewportId,
|
||||
}
|
||||
|
||||
/// A key whose repeats, and the text they type, are dropped until it is let go.
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
struct Swallowed {
|
||||
key: Key,
|
||||
physical: Option<Key>,
|
||||
viewport: egui::ViewportId,
|
||||
}
|
||||
|
||||
/// The hold shortcut state of the app: at most one waiting press, and the keys held down after
|
||||
/// their wait ended.
|
||||
#[derive(Default)]
|
||||
pub(crate) struct HoldKeys {
|
||||
pending: Option<Pending>,
|
||||
swallowed: Vec<Swallowed>,
|
||||
}
|
||||
|
||||
/// Is `e` the release of the key `key` at `physical`? The position decides when both events give
|
||||
/// one; otherwise the key decides.
|
||||
fn releases(e: &egui::Event, key: Key, physical: Option<Key>) -> bool {
|
||||
matches!(e, egui::Event::Key { key: k, physical_key: p, pressed: false, .. } if same_key(*k, *p, key, physical))
|
||||
}
|
||||
|
||||
fn same_key(k: Key, p: Option<Key>, key: Key, physical: Option<Key>) -> bool {
|
||||
match (p, physical) {
|
||||
(Some(p), Some(q)) => p == q,
|
||||
_ => k == key || Some(k) == physical,
|
||||
}
|
||||
}
|
||||
|
||||
/// Is the key still down? egui keeps the keys down by the key it reported for the press.
|
||||
fn is_down(i: &egui::InputState, key: Key, physical: Option<Key>) -> bool {
|
||||
i.key_down(key) || physical.is_some_and(|p| i.key_down(p))
|
||||
}
|
||||
|
||||
/// What stops a wait: anything that takes the keyboard from the canvas.
|
||||
fn blocked(app: &VectorcraftApp, ctx: &egui::Context) -> bool {
|
||||
crate::scrub::phase(ctx) != crate::scrub::Phase::Idle
|
||||
|| crate::updates_ui::blocks_input(app)
|
||||
|| app.ui.dialog.is_some()
|
||||
|| app.ui.palette_open
|
||||
|| app.ui.screen_mode == 3
|
||||
|| ctx.egui_wants_keyboard_input()
|
||||
|| app.session.tool_wants_text()
|
||||
|| app.session.tool_composing()
|
||||
|| app.session.tool_busy()
|
||||
// An input method composing on the canvas with any tool.
|
||||
|| ctx.input(|i| i.events.iter().any(|e| matches!(e, egui::Event::Ime(egui::ImeEvent::Preedit { text, .. }) if !text.is_empty())))
|
||||
}
|
||||
|
||||
/// Every frame, before anything can return: drops the repeats of the keys held after their wait
|
||||
/// ended or while it waits, and the text they type, also on frames that run no shortcut. Ends the
|
||||
/// wait without running anything when the window lost the keyboard, or when a field, a dialog,
|
||||
/// Presentation Mode, a numeric scrub, an IME composition or a busy tool has it.
|
||||
pub(super) fn guard(app: &mut VectorcraftApp, ctx: &egui::Context, focused: bool) {
|
||||
let viewport = ctx.viewport_id();
|
||||
if !focused {
|
||||
// egui lets go of every key when the window loses the keyboard.
|
||||
if app.hold_keys.pending.as_ref().is_some_and(|p| p.viewport == viewport) {
|
||||
app.hold_keys.pending = None;
|
||||
}
|
||||
app.hold_keys.swallowed.retain(|s| s.viewport != viewport);
|
||||
return;
|
||||
}
|
||||
let mut held: Vec<(Key, Option<Key>)> = app.hold_keys.swallowed.iter().filter(|s| s.viewport == viewport).map(|s| (s.key, s.physical)).collect();
|
||||
held.extend(app.hold_keys.pending.as_ref().filter(|p| p.viewport == viewport).map(|p| (p.key, p.physical)));
|
||||
// A wait that ends here still drops this frame's repeats of its key, also when the frame lets
|
||||
// the key go.
|
||||
if app.hold_keys.pending.as_ref().is_some_and(|p| p.viewport == viewport) && (blocked(app, ctx) || !app.session.prefs.hold_shortcuts) {
|
||||
cancel(app, ctx);
|
||||
}
|
||||
if held.is_empty() {
|
||||
return;
|
||||
}
|
||||
drop_repeats(ctx, &held);
|
||||
// A key let go, or pressed anew, is no longer held back after this frame: a repeat that came
|
||||
// in the same frame as its release was dropped above.
|
||||
ctx.input(|i| {
|
||||
app.hold_keys.swallowed.retain(|s| {
|
||||
s.viewport != viewport
|
||||
|| is_down(i, s.key, s.physical)
|
||||
&& !i.events.iter().any(|e| {
|
||||
releases(e, s.key, s.physical)
|
||||
|| matches!(e, egui::Event::Key { key, physical_key, pressed: true, repeat: false, .. } if same_key(*key, *physical_key, s.key, s.physical))
|
||||
})
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/// Removes this frame's repeats of the keys `held`, and the text they type.
|
||||
fn drop_repeats(ctx: &egui::Context, held: &[(Key, Option<Key>)]) {
|
||||
let repeat = |e: Option<&egui::Event>| {
|
||||
matches!(e, Some(egui::Event::Key { key, physical_key, pressed: true, repeat: true, .. })
|
||||
if held.iter().any(|(k, p)| same_key(*key, *physical_key, *k, *p)))
|
||||
};
|
||||
ctx.input_mut(|i| {
|
||||
let typed_by = super::typing_presses(&i.events);
|
||||
let drop: Vec<bool> = i
|
||||
.events
|
||||
.iter()
|
||||
.zip(typed_by)
|
||||
.map(|(e, by)| repeat(Some(e)) || matches!(e, egui::Event::Text(_)) && repeat(by.and_then(|k| i.events.get(k))))
|
||||
.collect();
|
||||
let mut drop = drop.into_iter();
|
||||
i.events.retain(|_| !drop.next().unwrap_or(false));
|
||||
});
|
||||
}
|
||||
|
||||
/// Ends the wait without running anything; the key's repeats stay held back until it is let go.
|
||||
fn cancel(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
let Some(p) = app.hold_keys.pending.take() else { return };
|
||||
if ctx.input(|i| is_down(i, p.key, p.physical)) {
|
||||
app.hold_keys.swallowed.push(Swallowed { key: p.key, physical: p.physical, viewport: p.viewport });
|
||||
}
|
||||
}
|
||||
|
||||
/// Runs the result of the wait: the hold shortcut when `hold`, otherwise the tap. `down`: the key
|
||||
/// is still down, so its repeats are held back until it is let go. True when the result opened a
|
||||
/// dialog or the palette.
|
||||
fn settle(app: &mut VectorcraftApp, ctx: &egui::Context, hold: bool, down: bool) -> bool {
|
||||
let Some(p) = app.hold_keys.pending.take() else { return false };
|
||||
if down {
|
||||
app.hold_keys.swallowed.push(Swallowed { key: p.key, physical: p.physical, viewport: p.viewport });
|
||||
}
|
||||
if hold {
|
||||
super::run_hit(app, ctx, &crate::keymap::command_of(&p.entry));
|
||||
} else {
|
||||
// The key is already up, or another key went down: a tool it chooses is chosen for good.
|
||||
super::run_single_key(app, ctx, &p.chords, None, false);
|
||||
}
|
||||
let opened = super::dialog_or_palette_open(app);
|
||||
if opened && down {
|
||||
// The key's repeats do not reach the dialog.
|
||||
let id = super::opening_key_id(ctx);
|
||||
ctx.data_mut(|m| m.insert_temp(id, p.key));
|
||||
}
|
||||
opened
|
||||
}
|
||||
|
||||
/// The chords a press names for a hold shortcut, first match first: the key itself with its Shift
|
||||
/// (Shift+1 typing `!`), then those of the text it typed, as a single-key shortcut reads them. When
|
||||
/// one entry holds Shift+1 and another `!`, Shift+1 runs the first. A letter names only the chord
|
||||
/// with its own Shift state: a hold on X does not catch Shift+X.
|
||||
fn press_chords(text: &str, key: Key, m: Modifiers) -> Vec<craft_keymap::Chord> {
|
||||
let mut chords = super::text_chords(text, m, Some(key));
|
||||
if !text.is_empty() && text.chars().all(char::is_alphabetic) {
|
||||
chords.retain(|c| c.mods.shift == m.shift);
|
||||
}
|
||||
let shift = Modifiers { shift: m.shift, ..Modifiers::NONE };
|
||||
if let Some(c) = crate::shortcut_editor::chord_from_event(key, shift).and_then(|t| crate::keymap::vc_chord(&t)) {
|
||||
chords.retain(|t| *t != c);
|
||||
chords.insert(0, c);
|
||||
}
|
||||
chords
|
||||
}
|
||||
|
||||
/// The chords a quick press runs, as the key runs without a hold shortcut: a shortcut on a shifted
|
||||
/// punctuation key itself (Shift+.), which the shortcuts read from the key press, then those of
|
||||
/// the text it typed.
|
||||
fn tap_chords(text: &str, key: Key, m: Modifiers) -> Vec<craft_keymap::Chord> {
|
||||
let shift = Modifiers { shift: m.shift, ..Modifiers::NONE };
|
||||
let pressed = crate::shortcut_editor::chord_from_event(key, shift)
|
||||
.and_then(|t| crate::keymap::vc_chord(&t))
|
||||
.filter(|c| c.mods.shift && c.key.name().chars().all(|ch| !ch.is_alphanumeric()));
|
||||
let mut chords: Vec<craft_keymap::Chord> = super::text_chords(text, m, Some(key)).into_iter().filter(|c| pressed.as_ref() != Some(c)).collect();
|
||||
if let Some(c) = pressed {
|
||||
chords.insert(0, c);
|
||||
}
|
||||
chords
|
||||
}
|
||||
|
||||
/// Does the active tool take this key itself (a digit with the perspective grid showing, a bracket
|
||||
/// with the Blob Brush, E with the Extend Path tool)? Then the key keeps doing that and does not
|
||||
/// wait.
|
||||
fn tool_takes(app: &mut VectorcraftApp, key: Key, text: &str) -> bool {
|
||||
let view = app.view_info();
|
||||
let tool_key = match text {
|
||||
"[" | "{" => Some(ToolKey::BracketLeft),
|
||||
"]" | "}" => Some(ToolKey::BracketRight),
|
||||
_ => super::digit_of(key).map(ToolKey::Digit).or_else(|| super::letter_of(key).map(ToolKey::Letter)),
|
||||
};
|
||||
tool_key.is_some_and(|k| app.session.tool_claims_key(k, view))
|
||||
}
|
||||
|
||||
/// Is there a press before the event at `start` that no wait took and that the frame handles: one
|
||||
/// with Cmd, Ctrl or Alt, or one that typed a text of a key the active tool takes ([`tool_takes`])?
|
||||
fn chord_before(app: &mut VectorcraftApp, events: &[egui::Event], typed_by: &[Option<usize>], start: usize, taken: &[usize]) -> bool {
|
||||
let mut before = events.iter().enumerate().take(start).filter(|(k, _)| !taken.contains(k));
|
||||
before.any(|(k, e)| match e {
|
||||
egui::Event::Key { key, pressed: true, modifiers: m, .. } if !super::is_modifier(*key) => {
|
||||
m.command
|
||||
|| m.ctrl
|
||||
|| m.alt
|
||||
|| m.mac_cmd
|
||||
|| typed_by
|
||||
.iter()
|
||||
.enumerate()
|
||||
.any(|(t, by)| *by == Some(k) && matches!(events.get(t), Some(egui::Event::Text(text)) if tool_takes(app, *key, text)))
|
||||
}
|
||||
_ => false,
|
||||
})
|
||||
}
|
||||
|
||||
/// Runs the single-key shortcuts of the texts typed before the event at `start` that no wait took,
|
||||
/// in order, as the frame's shortcuts would run them, and takes them and their presses from the
|
||||
/// frame. A text typed with Cmd, Ctrl or Alt, by a key the active tool takes, or with no shortcut,
|
||||
/// is left to the frame. When one opened a dialog or the palette, the position of its first event
|
||||
/// in the frame: its press, or its text where the text came first (the web build).
|
||||
fn run_typed_before(
|
||||
app: &mut VectorcraftApp,
|
||||
ctx: &egui::Context,
|
||||
events: &[egui::Event],
|
||||
typed_by: &[Option<usize>],
|
||||
start: usize,
|
||||
taken: &mut Vec<usize>,
|
||||
) -> Option<usize> {
|
||||
for (k, e) in events.iter().enumerate().take(start) {
|
||||
let egui::Event::Text(text) = e else { continue };
|
||||
let by = typed_by.get(k).copied().flatten();
|
||||
if taken.contains(&k) || by.is_some_and(|b| taken.contains(&b)) {
|
||||
continue;
|
||||
}
|
||||
let (key, physical, repeat, m) = match by.and_then(|b| events.get(b)) {
|
||||
Some(egui::Event::Key { key, physical_key, repeat, modifiers, .. }) => (Some(*key), *physical_key, *repeat, *modifiers),
|
||||
_ => (None, None, false, ctx.input(|i| i.modifiers)),
|
||||
};
|
||||
if m.command || m.ctrl || m.alt || m.mac_cmd || key.is_some_and(|key| tool_takes(app, key, text)) {
|
||||
continue;
|
||||
}
|
||||
let typed = super::latin(text, physical);
|
||||
let chords = match key {
|
||||
Some(key) => tap_chords(&typed, key, m),
|
||||
None => super::text_chords(&typed, m, None),
|
||||
};
|
||||
// A key with no shortcut stays in the frame for what reads it later (Space for the canvas).
|
||||
let keymap = crate::shortcut_editor::current();
|
||||
if !chords.iter().any(|c| crate::keymap::lookup(&keymap.keymap, c).is_some()) {
|
||||
continue;
|
||||
}
|
||||
taken.push(k);
|
||||
taken.extend(by);
|
||||
if super::run_single_key(app, ctx, &chords, key, repeat) {
|
||||
return Some(by.map_or(k, |b| b.min(k)));
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
/// Before the frame's shortcuts run: goes through the frame's events in order. A release of the
|
||||
/// waiting key ends the wait (the hold when the delay has passed, otherwise the tap); a press of
|
||||
/// another key, or a change of Cmd, Ctrl or Alt, ends it first, so the keys act in the order they
|
||||
/// went down; and a new press of a key with a hold shortcut starts a wait, taking the press and
|
||||
/// its text from the frame, with the key's repeats that follow in the frame and their text. When a
|
||||
/// wait that started in this frame also ends in it, the keys typed before its key run first
|
||||
/// ([`run_typed_before`]), so they act in the order they went down; after a chord with Cmd, Ctrl
|
||||
/// or Alt, or a key the active tool takes, before its key, the key goes back to the frame instead
|
||||
/// ([`chord_before`]). Then a wait
|
||||
/// whose delay has passed with the key down runs the hold shortcut. True when a result opened a
|
||||
/// dialog or the palette: the rest of the frame's keys are dropped and no other shortcut runs.
|
||||
pub(super) fn intake(app: &mut VectorcraftApp, ctx: &egui::Context) -> bool {
|
||||
// Off (Keyboard Shortcuts › Hold Shortcuts), every key runs on its press.
|
||||
if !app.session.prefs.hold_shortcuts || blocked(app, ctx) {
|
||||
return false;
|
||||
}
|
||||
let viewport = ctx.viewport_id();
|
||||
let (events, now) = ctx.input(|i| (i.events.clone(), i.time));
|
||||
let typed_by = super::typing_presses(&events);
|
||||
let text_of = |k: usize| typed_by.iter().position(|by| *by == Some(k)).and_then(|j| events.get(j).map(|e| (j, e)));
|
||||
let mut taken: Vec<usize> = vec![];
|
||||
let mut stop_at = None;
|
||||
// The press of a wait that started in this frame, and how many events were taken before it:
|
||||
// when the wait also ends in this frame, the keys typed before it run first.
|
||||
let mut started: Option<(usize, usize)> = None;
|
||||
for (j, e) in events.iter().enumerate() {
|
||||
if let Some(p) = app.hold_keys.pending.as_ref().filter(|p| p.viewport == viewport) {
|
||||
let overdue = now - p.since >= p.delay;
|
||||
let ended = if releases(e, p.key, p.physical) {
|
||||
Some((overdue, false))
|
||||
} else {
|
||||
match e {
|
||||
egui::Event::Key { key, physical_key, pressed: true, .. }
|
||||
if !super::is_modifier(*key) && !same_key(*key, *physical_key, p.key, p.physical) =>
|
||||
{
|
||||
Some((overdue, true))
|
||||
}
|
||||
// A new press of the waiting key whose release was never seen.
|
||||
egui::Event::Key { key, physical_key, pressed: true, repeat: false, .. } if same_key(*key, *physical_key, p.key, p.physical) => {
|
||||
Some((false, false))
|
||||
}
|
||||
egui::Event::ModifiersChanged(m) if (m.command, m.ctrl, m.alt) != (p.mods.command, p.mods.ctrl, p.mods.alt) => {
|
||||
Some((false, true))
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
};
|
||||
if let Some((hold, down)) = ended {
|
||||
let start = started.take();
|
||||
// After a chord with Cmd, Ctrl or Alt pressed before it, which the frame's shortcuts
|
||||
// run, or a key the active tool takes, the key goes back to the frame without
|
||||
// waiting, so the frame handles it as it does with Hold Shortcuts off and its tap
|
||||
// does not run before that key. Its press, its repeats and their texts stay in the
|
||||
// frame, and its later repeats reach later frames.
|
||||
if let Some((start, before)) = start
|
||||
&& chord_before(app, &events, &typed_by, start, &taken)
|
||||
{
|
||||
app.hold_keys.pending = None;
|
||||
taken.truncate(before);
|
||||
} else if let Some((start, _)) = start
|
||||
&& let Some(opened) = run_typed_before(app, ctx, &events, &typed_by, start, &mut taken)
|
||||
{
|
||||
// A key typed before it that opened a dialog or the palette ends the wait
|
||||
// without running it.
|
||||
cancel(app, ctx);
|
||||
stop_at = Some(opened);
|
||||
break;
|
||||
} else if settle(app, ctx, hold, down) {
|
||||
stop_at = Some(j);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
let egui::Event::Key { key, physical_key, pressed: true, repeat: false, modifiers: m } = e else { continue };
|
||||
if m.command || m.ctrl || m.alt || m.mac_cmd || super::is_modifier(*key) {
|
||||
continue;
|
||||
}
|
||||
// Only a press that typed a text waits: a text alone has no key to let go.
|
||||
let Some((t, egui::Event::Text(text))) = text_of(j) else { continue };
|
||||
let typed = super::latin(text, *physical_key);
|
||||
let Some(entry) =
|
||||
press_chords(&typed, *key, *m).iter().find_map(|c| crate::shortcut_editor::hold_for(&app.ui.shortcut_holds, c)).map(str::to_string)
|
||||
else {
|
||||
continue;
|
||||
};
|
||||
let chords = tap_chords(&typed, *key, *m);
|
||||
if tool_takes(app, *key, text) {
|
||||
continue;
|
||||
}
|
||||
started = Some((j, taken.len()));
|
||||
taken.extend([j, t]);
|
||||
// The key's repeats in this frame, and the text they type, stay out of the frame too.
|
||||
for (r, later) in events.iter().enumerate().skip(j + 1) {
|
||||
if releases(later, *key, *physical_key) {
|
||||
break;
|
||||
}
|
||||
if matches!(later, egui::Event::Key { key: k, physical_key: p, pressed: true, repeat: true, .. } if same_key(*k, *p, *key, *physical_key))
|
||||
{
|
||||
taken.push(r);
|
||||
taken.extend(text_of(r).map(|(rt, _)| rt));
|
||||
}
|
||||
}
|
||||
// A wait left in another viewport ends without running: that window lost the keyboard to
|
||||
// this one. Its key's repeats stay held back there until it is let go.
|
||||
if let Some(old) = app.hold_keys.pending.take_if(|p| p.viewport != viewport) {
|
||||
app.hold_keys.swallowed.push(Swallowed { key: old.key, physical: old.physical, viewport: old.viewport });
|
||||
}
|
||||
let delay = app.session.prefs.key_hold_delay();
|
||||
app.hold_keys.pending = Some(Pending { entry, chords, key: *key, physical: *physical_key, mods: *m, since: now, delay, viewport });
|
||||
}
|
||||
// Take the waiting presses and their texts, and after a result that opened a dialog, the key
|
||||
// event that ended the wait (or the typed key that opened the dialog, when that came earlier)
|
||||
// and every later key event and text of the frame, with the text a
|
||||
// press typed before it (the web build sends a press's text first): none of them reaches the
|
||||
// dialog.
|
||||
ctx.input_mut(|i| {
|
||||
if i.events.len() != events.len() {
|
||||
return;
|
||||
}
|
||||
let mut j = 0;
|
||||
i.events.retain(|e| {
|
||||
let k = j;
|
||||
j += 1;
|
||||
let later = stop_at.is_some_and(|s| {
|
||||
k >= s && matches!(e, egui::Event::Key { .. } | egui::Event::Text(_))
|
||||
|| matches!(e, egui::Event::Text(_)) && typed_by.get(k).copied().flatten().is_some_and(|by| by >= s)
|
||||
});
|
||||
!(taken.contains(&k) || later)
|
||||
});
|
||||
});
|
||||
if stop_at.is_some() {
|
||||
return true;
|
||||
}
|
||||
let Some(p) = app.hold_keys.pending.as_ref().filter(|p| p.viewport == viewport) else { return false };
|
||||
let deadline = p.since + p.delay;
|
||||
let down = ctx.input(|i| is_down(i, p.key, p.physical));
|
||||
if !down {
|
||||
// Let go without a release this frame saw.
|
||||
return settle(app, ctx, now >= deadline, false);
|
||||
}
|
||||
if now >= deadline {
|
||||
return settle(app, ctx, true, true);
|
||||
}
|
||||
// egui draws only on input, and a held key need not repeat: draw again at the deadline.
|
||||
ctx.request_repaint_after_secs((deadline - now) as f32);
|
||||
false
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
@@ -0,0 +1,757 @@
|
||||
use serde_json::json;
|
||||
|
||||
use super::super::handle;
|
||||
use super::*;
|
||||
|
||||
/// A keyboard on one context, so egui keeps the keys held down from frame to frame and marks a
|
||||
/// held key's later presses as repeats, with the frame times the test sets.
|
||||
struct Keyboard {
|
||||
ctx: egui::Context,
|
||||
}
|
||||
|
||||
impl Keyboard {
|
||||
fn new() -> Self {
|
||||
Self { ctx: egui::Context::default() }
|
||||
}
|
||||
|
||||
/// One frame at `time` seconds delivering `events`, with the window having the keyboard
|
||||
/// (`focused`) or not.
|
||||
fn frame_with_focus(&self, app: &mut VectorcraftApp, time: f64, events: Vec<egui::Event>, focused: bool) {
|
||||
let screen_rect = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(800.0, 600.0)));
|
||||
let mut out = self.ctx.run_ui(egui::RawInput { events, screen_rect, time: Some(time), focused, ..Default::default() }, |ui| {
|
||||
app.logic(ui.ctx());
|
||||
handle(app, ui.ctx());
|
||||
});
|
||||
out.textures_delta.clear();
|
||||
}
|
||||
|
||||
fn frame(&self, app: &mut VectorcraftApp, time: f64, events: Vec<egui::Event>) {
|
||||
self.frame_with_focus(app, time, events, true);
|
||||
}
|
||||
|
||||
/// [`Self::frame`], giving the events the shortcuts left in the first pass for what is drawn
|
||||
/// after them.
|
||||
fn frame_left(&self, app: &mut VectorcraftApp, time: f64, events: Vec<egui::Event>) -> Vec<egui::Event> {
|
||||
let screen_rect = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(800.0, 600.0)));
|
||||
let mut left = None;
|
||||
let mut out = self.ctx.run_ui(egui::RawInput { events, screen_rect, time: Some(time), focused: true, ..Default::default() }, |ui| {
|
||||
app.logic(ui.ctx());
|
||||
handle(app, ui.ctx());
|
||||
if left.is_none() {
|
||||
left = Some(ui.ctx().input(|i| i.events.clone()));
|
||||
}
|
||||
});
|
||||
out.textures_delta.clear();
|
||||
left.unwrap_or_default()
|
||||
}
|
||||
|
||||
/// `key` pressed (a repeat when it is already down) at `time`, typing `text`.
|
||||
fn press(&self, app: &mut VectorcraftApp, time: f64, key: Key, text: &str) {
|
||||
self.frame(app, time, press(key, text, Modifiers::NONE));
|
||||
}
|
||||
|
||||
fn release(&self, app: &mut VectorcraftApp, time: f64, key: Key) {
|
||||
self.frame(app, time, vec![release(key)]);
|
||||
}
|
||||
}
|
||||
|
||||
fn press(key: Key, text: &str, modifiers: Modifiers) -> Vec<egui::Event> {
|
||||
vec![egui::Event::Key { key, physical_key: Some(key), pressed: true, repeat: false, modifiers }, egui::Event::Text(text.into())]
|
||||
}
|
||||
|
||||
fn release(key: Key) -> egui::Event {
|
||||
egui::Event::Key { key, physical_key: Some(key), pressed: false, repeat: false, modifiers: Modifiers::NONE }
|
||||
}
|
||||
|
||||
/// A document with a selected rectangle filled red with a blue stroke, the Pen tool chosen, and
|
||||
/// Hold Shortcuts `on`.
|
||||
fn app_with(on: bool) -> VectorcraftApp {
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
|
||||
crate::shortcut_editor::sync(&app.ui);
|
||||
app.run("file.new", json!({"width": 400, "height": 300})).unwrap();
|
||||
app.run("shape.rectangle", json!({"x": 100, "y": 100, "width": 100, "height": 50})).unwrap();
|
||||
app.run("paint.setFill", json!({"color": "#ff0000"})).unwrap();
|
||||
app.run("paint.setStroke", json!({"color": "#0000ff"})).unwrap();
|
||||
app.run("prefs.set", json!({"key": "holdShortcuts", "value": on})).unwrap();
|
||||
app.select_tool("pen");
|
||||
app
|
||||
}
|
||||
|
||||
/// erolka's X: a quick press chooses the Eyedropper, and holding X swaps fill and stroke.
|
||||
fn erolka_x(on: bool) -> VectorcraftApp {
|
||||
let mut app = app_with(on);
|
||||
app.run("shortcuts.set", json!({"id": "tool:eyedropper", "shortcut": "X", "force": true})).unwrap();
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "X"})).unwrap();
|
||||
app
|
||||
}
|
||||
|
||||
/// The fill of the selected object, as `#rrggbb`.
|
||||
fn fill(app: &VectorcraftApp) -> String {
|
||||
let d = app.session.active().unwrap();
|
||||
let id = *d.selection.objects.first().unwrap();
|
||||
d.doc.node(id).unwrap().appearance.fill_paint().color().unwrap().to_hex()
|
||||
}
|
||||
|
||||
fn selected(app: &VectorcraftApp) -> usize {
|
||||
app.session.active().unwrap().selection.objects.len()
|
||||
}
|
||||
|
||||
/// A quick press of X runs its tap at the release, and holding X runs the hold once at the delay,
|
||||
/// also with no repeats; the repeats until the release run nothing more.
|
||||
#[test]
|
||||
fn a_tap_runs_the_key_and_a_hold_runs_the_hold_shortcut() {
|
||||
let mut app = erolka_x(true);
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::X, "x");
|
||||
assert_eq!(app.session.tool_id(), "pen", "the press waits");
|
||||
keys.release(&mut app, 0.1, Key::X);
|
||||
assert_eq!(app.session.tool_id(), "eyedropper", "the quick press chooses the Eyedropper");
|
||||
assert_eq!(fill(&app), "#ff0000", "and swaps nothing");
|
||||
|
||||
app.select_tool("pen");
|
||||
keys.press(&mut app, 1.0, Key::X, "x");
|
||||
keys.frame(&mut app, 1.2, vec![]);
|
||||
assert_eq!(fill(&app), "#ff0000", "before the delay nothing runs");
|
||||
keys.frame(&mut app, 1.35, vec![]);
|
||||
assert_eq!(fill(&app), "#0000ff", "at the delay the hold swaps fill and stroke");
|
||||
assert_eq!(app.session.tool_id(), "pen", "and chooses no tool");
|
||||
for t in [1.5, 1.6, 1.7] {
|
||||
keys.press(&mut app, t, Key::X, "x");
|
||||
}
|
||||
keys.release(&mut app, 1.8, Key::X);
|
||||
assert_eq!(fill(&app), "#0000ff", "the repeats and the release swap nothing more");
|
||||
assert_eq!(app.session.tool_id(), "pen");
|
||||
}
|
||||
|
||||
/// The delay is the Hold Shortcut Delay read at the press.
|
||||
#[test]
|
||||
fn the_hold_waits_for_the_hold_shortcut_delay() {
|
||||
let mut app = erolka_x(true);
|
||||
app.run("prefs.set", json!({"key": "keyHoldDelay", "value": 0.8})).unwrap();
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::X, "x");
|
||||
app.run("prefs.set", json!({"key": "keyHoldDelay", "value": 0.2})).unwrap();
|
||||
keys.frame(&mut app, 0.5, vec![]);
|
||||
assert_eq!(fill(&app), "#ff0000", "a later change does not move the wait");
|
||||
keys.frame(&mut app, 0.8, vec![]);
|
||||
assert_eq!(fill(&app), "#0000ff");
|
||||
}
|
||||
|
||||
/// erolka's `.`: a quick press keeps the key's own command (Apply Last Gradient) and keeps the
|
||||
/// selection, and holding it deselects.
|
||||
#[test]
|
||||
fn the_period_key_taps_its_own_command_and_holds_to_deselect() {
|
||||
let mut app = app_with(true);
|
||||
app.run("shortcuts.set", json!({"id": "select.none", "hold": "."})).unwrap();
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::Period, ".");
|
||||
keys.release(&mut app, 0.1, Key::Period);
|
||||
assert_eq!(selected(&app), 1, "the quick press keeps the selection");
|
||||
let d = app.session.active().unwrap();
|
||||
let id = *d.selection.objects.first().unwrap();
|
||||
let appearance = &d.doc.node(id).unwrap().appearance;
|
||||
let gradient = |p: vectorcraft_color::Paint| matches!(p, vectorcraft_color::Paint::Gradient(_));
|
||||
assert!(gradient(appearance.fill_paint()) || gradient(appearance.stroke_paint()), "and applies the last gradient");
|
||||
// Solid paint again, so a hold that also ran the tap would show.
|
||||
app.run("paint.setFill", json!({"color": "#ff0000"})).unwrap();
|
||||
app.run("paint.setStroke", json!({"color": "#0000ff"})).unwrap();
|
||||
keys.press(&mut app, 1.0, Key::Period, ".");
|
||||
keys.frame(&mut app, 1.4, vec![]);
|
||||
assert_eq!(selected(&app), 0, "the hold deselects");
|
||||
keys.release(&mut app, 1.5, Key::Period);
|
||||
let appearance = &app.session.active().unwrap().doc.node(id).unwrap().appearance;
|
||||
assert!(!gradient(appearance.fill_paint()) && !gradient(appearance.stroke_paint()), "and applies no gradient");
|
||||
}
|
||||
|
||||
/// A hold on a letter alone does not catch the letter with Shift: Shift+X, held, does with Hold
|
||||
/// Shortcuts on what it does with them off, and does not wait.
|
||||
#[test]
|
||||
fn a_hold_on_a_letter_leaves_the_letter_with_shift_alone() {
|
||||
let mut results = vec![];
|
||||
for on in [false, true] {
|
||||
let mut app = erolka_x(on);
|
||||
let keys = Keyboard::new();
|
||||
keys.frame(&mut app, 0.0, press(Key::X, "X", Modifiers::SHIFT));
|
||||
assert!(app.hold_keys.pending.is_none(), "Shift+X does not wait (on {on})");
|
||||
let pressed = (fill(&app), app.session.tool_id().to_string());
|
||||
keys.frame(&mut app, 1.0, vec![]);
|
||||
keys.frame(&mut app, 1.1, vec![release(Key::X)]);
|
||||
results.push((pressed, fill(&app), app.session.tool_id().to_string()));
|
||||
}
|
||||
assert_eq!(results[0], results[1], "holding Shift+X does not run X's hold");
|
||||
}
|
||||
|
||||
/// A letter the active tool takes itself (E with the Extend Path tool) does not wait, also with a
|
||||
/// hold shortcut on it.
|
||||
#[test]
|
||||
fn a_letter_the_tool_takes_does_not_wait() {
|
||||
let mut app = app_with(true);
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "E"})).unwrap();
|
||||
app.select_tool(vectorcraft_tools::addons::extend_path::ID);
|
||||
assert_eq!(app.session.tool_id(), vectorcraft_tools::addons::extend_path::ID);
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::E, "e");
|
||||
assert!(app.hold_keys.pending.is_none(), "E stays the tool's");
|
||||
keys.frame(&mut app, 1.0, vec![]);
|
||||
keys.release(&mut app, 1.1, Key::E);
|
||||
assert_eq!(fill(&app), "#ff0000", "the hold does not run");
|
||||
assert_eq!(app.session.tool_id(), vectorcraft_tools::addons::extend_path::ID);
|
||||
}
|
||||
|
||||
/// An input method that starts composing while a key waits ends the wait without running anything.
|
||||
#[test]
|
||||
fn an_input_method_composition_ends_the_wait() {
|
||||
let mut app = erolka_x(true);
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::X, "x");
|
||||
assert!(app.hold_keys.pending.is_some());
|
||||
keys.frame(&mut app, 0.1, vec![egui::Event::Ime(egui::ImeEvent::Preedit { text: "か".into(), active_range_chars: Some(1..1) })]);
|
||||
assert!(app.hold_keys.pending.is_none(), "the composition ends the wait");
|
||||
keys.frame(&mut app, 1.0, vec![]);
|
||||
keys.release(&mut app, 1.1, Key::X);
|
||||
assert_eq!(app.session.tool_id(), "pen", "no tap ran");
|
||||
assert_eq!(fill(&app), "#ff0000", "and no hold");
|
||||
}
|
||||
|
||||
/// A dialog opened, or Presentation Mode entered, while a key waits ends the wait without running
|
||||
/// anything.
|
||||
#[test]
|
||||
fn a_dialog_or_presentation_mode_ends_the_wait() {
|
||||
for what in ["dialog", "Presentation Mode"] {
|
||||
let mut app = erolka_x(true);
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::X, "x");
|
||||
assert!(app.hold_keys.pending.is_some(), "{what}");
|
||||
if what == "dialog" {
|
||||
app.ui.dialog = Some(crate::state::Dialog::new("preferences", json!({})));
|
||||
} else {
|
||||
app.ui.screen_mode = 3;
|
||||
}
|
||||
keys.frame(&mut app, 0.1, vec![]);
|
||||
assert!(app.hold_keys.pending.is_none(), "{what} ends the wait");
|
||||
app.ui.dialog = None;
|
||||
app.ui.screen_mode = 0;
|
||||
keys.frame(&mut app, 1.0, vec![]);
|
||||
keys.release(&mut app, 1.1, Key::X);
|
||||
assert_eq!(app.session.tool_id(), "pen", "{what}: no tap ran");
|
||||
assert_eq!(fill(&app), "#ff0000", "{what}: and no hold");
|
||||
}
|
||||
}
|
||||
|
||||
/// A dialog opened while a key waits does not get the key's repeat, or the text it types, from the
|
||||
/// frame that also lets the key go.
|
||||
#[test]
|
||||
fn a_dialog_that_ends_the_wait_gets_no_repeat_from_the_frame_of_the_release() {
|
||||
let mut app = erolka_x(true);
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::X, "x");
|
||||
assert!(app.hold_keys.pending.is_some());
|
||||
app.ui.dialog = Some(crate::state::Dialog::new("preferences", json!({})));
|
||||
let mut events = press(Key::X, "x", Modifiers::NONE);
|
||||
events.push(release(Key::X));
|
||||
let left = keys.frame_left(&mut app, 0.1, events);
|
||||
assert!(app.hold_keys.pending.is_none(), "the dialog ends the wait");
|
||||
assert!(
|
||||
!left.iter().any(|e| matches!(e, egui::Event::Text(_) | egui::Event::Key { pressed: true, .. })),
|
||||
"neither the repeat nor its text reaches the dialog: {left:?}"
|
||||
);
|
||||
}
|
||||
|
||||
/// A new wait does not drop a wait left in another viewport unseen: that wait ends, and its key's
|
||||
/// repeats stay held back in its viewport.
|
||||
#[test]
|
||||
fn a_wait_in_another_viewport_ends_when_a_new_one_starts() {
|
||||
let mut app = erolka_x(true);
|
||||
let other = egui::ViewportId::from_hash_of("another window");
|
||||
app.hold_keys.pending = Some(Pending {
|
||||
entry: "paint.swap".into(),
|
||||
chords: vec![],
|
||||
key: Key::X,
|
||||
physical: Some(Key::X),
|
||||
mods: Modifiers::NONE,
|
||||
since: 0.0,
|
||||
delay: 0.35,
|
||||
viewport: other,
|
||||
});
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.1, Key::X, "x");
|
||||
assert!(app.hold_keys.pending.as_ref().is_some_and(|p| p.viewport == egui::ViewportId::ROOT), "the new press waits here");
|
||||
assert!(app.hold_keys.swallowed.iter().any(|s| s.viewport == other && s.key == Key::X), "the other window's key stays held back");
|
||||
assert_eq!(fill(&app), "#ff0000", "the other wait ran nothing");
|
||||
}
|
||||
|
||||
/// With Hold Shortcuts off, a key with a hold shortcut runs on its press, as every key does, and
|
||||
/// holding it runs nothing else.
|
||||
#[test]
|
||||
fn with_hold_shortcuts_off_every_key_runs_on_its_press() {
|
||||
let mut app = erolka_x(false);
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::X, "x");
|
||||
assert_eq!(app.session.tool_id(), "eyedropper", "the press runs at once");
|
||||
keys.frame(&mut app, 1.0, vec![]);
|
||||
keys.release(&mut app, 1.2, Key::X);
|
||||
assert_eq!(fill(&app), "#ff0000", "the hold shortcut does not act");
|
||||
assert!(app.hold_keys.pending.is_none());
|
||||
}
|
||||
|
||||
/// Turning Hold Shortcuts off while a key waits ends the wait without running anything.
|
||||
#[test]
|
||||
fn turning_hold_shortcuts_off_ends_the_wait() {
|
||||
let mut app = erolka_x(true);
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::X, "x");
|
||||
assert!(app.hold_keys.pending.is_some());
|
||||
app.run("prefs.set", json!({"key": "holdShortcuts", "value": false})).unwrap();
|
||||
keys.frame(&mut app, 0.5, vec![]);
|
||||
keys.release(&mut app, 0.6, Key::X);
|
||||
assert!(app.hold_keys.pending.is_none());
|
||||
assert_eq!(fill(&app), "#ff0000", "no hold ran");
|
||||
assert_eq!(app.session.tool_id(), "pen", "and no tap");
|
||||
}
|
||||
|
||||
/// A key without a hold shortcut runs in its press frame, and a waiting key pressed before it acts
|
||||
/// first.
|
||||
#[test]
|
||||
fn another_key_ends_the_wait_and_runs_after_it() {
|
||||
let (swap, default) = (label("paint.swap"), label("paint.default"));
|
||||
let mut app = swap_on_x();
|
||||
app.select_tool("selection");
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::P, "p");
|
||||
assert_eq!(app.session.tool_id(), "pen", "P runs on its press");
|
||||
keys.release(&mut app, 0.05, Key::P);
|
||||
let n = steps(&app, 0).len();
|
||||
keys.press(&mut app, 0.1, Key::X, "x");
|
||||
assert_eq!(steps(&app, n), Vec::<String>::new(), "X waits");
|
||||
keys.press(&mut app, 0.2, Key::D, "d");
|
||||
assert_eq!(steps(&app, n), [swap.clone(), default.clone()], "X's tap ran, then D");
|
||||
keys.release(&mut app, 0.3, Key::X);
|
||||
keys.release(&mut app, 0.35, Key::D);
|
||||
assert_eq!(steps(&app, n), [swap, default], "the release of X runs nothing more");
|
||||
assert_eq!(selected(&app), 1, "and no hold");
|
||||
}
|
||||
|
||||
/// The labels of the document's undo steps after the first `from`.
|
||||
fn steps(app: &VectorcraftApp, from: usize) -> Vec<String> {
|
||||
app.session.doc().unwrap().history.undo.iter().skip(from).map(|e| e.label.clone()).collect()
|
||||
}
|
||||
|
||||
/// The label of the undo step `command` records on [`app_with`]'s document.
|
||||
fn label(command: &str) -> String {
|
||||
let mut app = app_with(true);
|
||||
let n = steps(&app, 0).len();
|
||||
app.run(command, json!({})).unwrap();
|
||||
steps(&app, n).pop().unwrap()
|
||||
}
|
||||
|
||||
/// A quick press of X swaps fill and stroke, and holding X deselects; D sets the default fill and
|
||||
/// stroke, as by default.
|
||||
fn swap_on_x() -> VectorcraftApp {
|
||||
let mut app = app_with(true);
|
||||
assert_eq!(crate::shortcut_editor::default_of("paint.default"), Some("D"));
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "shortcut": "X", "force": true})).unwrap();
|
||||
app.run("shortcuts.set", json!({"id": "select.none", "hold": "X"})).unwrap();
|
||||
app
|
||||
}
|
||||
|
||||
/// Two keys pressed in one frame act in the order they went down, each once.
|
||||
#[test]
|
||||
fn keys_in_one_frame_act_in_order() {
|
||||
let (swap, default) = (label("paint.swap"), label("paint.default"));
|
||||
assert_ne!(swap, default);
|
||||
let mut app = swap_on_x();
|
||||
let keys = Keyboard::new();
|
||||
let n = steps(&app, 0).len();
|
||||
let mut events = press(Key::X, "x", Modifiers::NONE);
|
||||
events.extend(press(Key::D, "d", Modifiers::NONE));
|
||||
keys.frame(&mut app, 0.0, events);
|
||||
assert_eq!(steps(&app, n), [swap.clone(), default.clone()], "X's tap first, then D");
|
||||
keys.frame(&mut app, 1.0, vec![release(Key::X), release(Key::D)]);
|
||||
// Paint that D changes again.
|
||||
app.run("paint.setFill", json!({"color": "#ff0000"})).unwrap();
|
||||
let n = steps(&app, 0).len();
|
||||
let mut events = press(Key::D, "d", Modifiers::NONE);
|
||||
events.extend(press(Key::X, "x", Modifiers::NONE));
|
||||
keys.frame(&mut app, 2.0, events);
|
||||
keys.frame(&mut app, 2.1, vec![release(Key::X)]);
|
||||
assert_eq!(steps(&app, n), [default, swap], "D first, then X's tap at its release");
|
||||
assert_eq!(selected(&app), 1, "and no hold");
|
||||
}
|
||||
|
||||
/// A wait that starts in a frame after another key, and that a release or another key ends in the
|
||||
/// same frame, runs its tap after that key.
|
||||
#[test]
|
||||
fn a_wait_ended_in_its_frame_runs_after_the_keys_before_it() {
|
||||
let (swap, default) = (label("paint.swap"), label("paint.default"));
|
||||
let mut app = swap_on_x();
|
||||
let keys = Keyboard::new();
|
||||
let n = steps(&app, 0).len();
|
||||
let mut events = press(Key::D, "d", Modifiers::NONE);
|
||||
events.extend(press(Key::X, "x", Modifiers::NONE));
|
||||
events.push(release(Key::X));
|
||||
keys.frame(&mut app, 0.0, events);
|
||||
assert_eq!(steps(&app, n), [default.clone(), swap.clone()], "D first, then X's tap");
|
||||
assert!(app.hold_keys.pending.is_none());
|
||||
keys.frame(&mut app, 1.0, vec![release(Key::D)]);
|
||||
assert_eq!(selected(&app), 1, "nothing waits after it");
|
||||
// Ended by V while X is still down: D, X's tap, then V.
|
||||
let n = steps(&app, 0).len();
|
||||
let mut events = press(Key::D, "d", Modifiers::NONE);
|
||||
events.extend(press(Key::X, "x", Modifiers::NONE));
|
||||
events.extend(press(Key::V, "v", Modifiers::NONE));
|
||||
keys.frame(&mut app, 2.0, events);
|
||||
assert_eq!(steps(&app, n), [default, swap], "D first, then X's tap");
|
||||
assert_eq!(app.session.tool_id(), "selection", "then V");
|
||||
keys.press(&mut app, 2.5, Key::X, "x");
|
||||
keys.frame(&mut app, 2.6, vec![release(Key::X), release(Key::D), release(Key::V)]);
|
||||
assert_eq!(steps(&app, n).len(), 2, "X's repeats run nothing");
|
||||
assert_eq!(selected(&app), 1, "and no hold");
|
||||
// Ended by a command chord (Deselect): D, X's tap, then the chord.
|
||||
assert_eq!(crate::shortcut_editor::default_of("select.none"), Some("Cmd+Shift+A"));
|
||||
app.run("paint.setFill", json!({"color": "#ff0000"})).unwrap();
|
||||
let n = steps(&app, 0).len();
|
||||
let mut events = press(Key::D, "d", Modifiers::NONE);
|
||||
events.extend(press(Key::X, "x", Modifiers::NONE));
|
||||
let modifiers = Modifiers::COMMAND | Modifiers::SHIFT;
|
||||
events.push(egui::Event::Key { key: Key::A, physical_key: Some(Key::A), pressed: true, repeat: false, modifiers });
|
||||
keys.frame(&mut app, 3.0, events);
|
||||
assert_eq!(steps(&app, n), [label("paint.default"), label("paint.swap")], "D first, then X's tap");
|
||||
assert_eq!(selected(&app), 0, "then the chord");
|
||||
}
|
||||
|
||||
/// A command chord (Undo) pressed before a wait that starts and ends in one frame runs first: the
|
||||
/// key's tap does not run before it, and the frame acts as it does with Hold Shortcuts off.
|
||||
#[test]
|
||||
fn a_chord_before_a_wait_ended_in_its_frame_runs_first() {
|
||||
assert_eq!(crate::shortcut_editor::default_of("edit.undo"), Some("Cmd+Z"));
|
||||
let frame = |app: &mut VectorcraftApp| {
|
||||
app.run("paint.setFill", json!({"color": "#00ff00"})).unwrap();
|
||||
let mut events =
|
||||
vec![egui::Event::Key { key: Key::Z, physical_key: Some(Key::Z), pressed: true, repeat: false, modifiers: Modifiers::COMMAND }];
|
||||
events.extend(press(Key::X, "x", Modifiers::NONE));
|
||||
events.push(release(Key::X));
|
||||
Keyboard::new().frame(app, 0.0, events);
|
||||
(fill(app), selected(app))
|
||||
};
|
||||
let mut off = swap_on_x();
|
||||
off.run("prefs.set", json!({"key": "holdShortcuts", "value": false})).unwrap();
|
||||
let off = frame(&mut off);
|
||||
let mut app = swap_on_x();
|
||||
let on = frame(&mut app);
|
||||
assert_eq!(on.0, "#ff0000", "Undo restores the red fill and does not undo X's swap");
|
||||
assert_eq!(on, off);
|
||||
assert!(app.hold_keys.pending.is_none());
|
||||
}
|
||||
|
||||
/// A key the active tool takes (E with the Extend Path tool), pressed before a wait that starts and
|
||||
/// ends in one frame, reaches the tool first: the key's tap, which chooses another tool, does not
|
||||
/// run before it, and the frame acts as it does with Hold Shortcuts off.
|
||||
#[test]
|
||||
fn a_tool_key_before_a_wait_ended_in_its_frame_reaches_the_tool_first() {
|
||||
let frame = |app: &mut VectorcraftApp| {
|
||||
app.select_tool(vectorcraft_tools::addons::extend_path::ID);
|
||||
let mut events = press(Key::E, "e", Modifiers::NONE);
|
||||
events.extend(press(Key::X, "x", Modifiers::NONE));
|
||||
events.push(release(Key::X));
|
||||
Keyboard::new().frame(app, 0.0, events);
|
||||
(app.session.tool_id().to_string(), fill(app))
|
||||
};
|
||||
let off = frame(&mut erolka_x(false));
|
||||
let mut app = erolka_x(true);
|
||||
let on = frame(&mut app);
|
||||
assert_eq!(on.0, "eyedropper", "X's tap chooses the Eyedropper after E reached the Extend Path tool");
|
||||
assert_eq!(on, off);
|
||||
assert!(app.hold_keys.pending.is_none());
|
||||
}
|
||||
|
||||
/// After a command chord before a wait that starts and ends in one frame, the key's repeats in
|
||||
/// that frame and in later ones, and the text they type, reach the frame as with Hold Shortcuts
|
||||
/// off.
|
||||
#[test]
|
||||
fn a_chord_before_a_wait_leaves_the_key_repeats_to_the_frame() {
|
||||
let run = |app: &mut VectorcraftApp| {
|
||||
app.run("paint.setFill", json!({"color": "#00ff00"})).unwrap();
|
||||
let n = steps(app, 0).len();
|
||||
let keys = Keyboard::new();
|
||||
let mut events =
|
||||
vec![egui::Event::Key { key: Key::Z, physical_key: Some(Key::Z), pressed: true, repeat: false, modifiers: Modifiers::COMMAND }];
|
||||
events.extend(press(Key::X, "x", Modifiers::NONE));
|
||||
events.extend(press(Key::X, "x", Modifiers::NONE));
|
||||
events.extend(press(Key::D, "d", Modifiers::NONE));
|
||||
let first = keys.frame_left(app, 0.0, events);
|
||||
let mut events = press(Key::X, "x", Modifiers::NONE);
|
||||
events.extend([release(Key::X), release(Key::D)]);
|
||||
let second = keys.frame_left(app, 0.05, events);
|
||||
(steps(app, n), first, second, fill(app))
|
||||
};
|
||||
let mut off = swap_on_x();
|
||||
off.run("prefs.set", json!({"key": "holdShortcuts", "value": false})).unwrap();
|
||||
let off = run(&mut off);
|
||||
let mut app = swap_on_x();
|
||||
let on = run(&mut app);
|
||||
assert_eq!(on, off);
|
||||
assert!(app.hold_keys.pending.is_none());
|
||||
assert!(app.hold_keys.swallowed.is_empty());
|
||||
}
|
||||
|
||||
/// The repeats of a key in the frame that starts its wait, and the text they type, stay out of the
|
||||
/// frame.
|
||||
#[test]
|
||||
fn repeats_in_the_frame_that_starts_a_wait_stay_out_of_it() {
|
||||
let mut app = swap_on_x();
|
||||
let keys = Keyboard::new();
|
||||
let n = steps(&app, 0).len();
|
||||
let mut events = press(Key::X, "x", Modifiers::NONE);
|
||||
events.extend(press(Key::X, "x", Modifiers::NONE));
|
||||
events.extend(press(Key::X, "x", Modifiers::NONE));
|
||||
let left = keys.frame_left(&mut app, 0.0, events);
|
||||
assert!(app.hold_keys.pending.is_some(), "X waits");
|
||||
assert!(!left.iter().any(|e| matches!(e, egui::Event::Text(_) | egui::Event::Key { pressed: true, .. })), "{left:?}");
|
||||
assert!(steps(&app, n).is_empty(), "the repeats run nothing");
|
||||
}
|
||||
|
||||
/// A press and its release in one frame are a tap, run in that frame.
|
||||
#[test]
|
||||
fn a_press_and_release_in_one_frame_is_a_tap() {
|
||||
let mut app = erolka_x(true);
|
||||
let keys = Keyboard::new();
|
||||
let mut events = press(Key::X, "x", Modifiers::NONE);
|
||||
events.push(release(Key::X));
|
||||
keys.frame(&mut app, 0.0, events);
|
||||
assert_eq!(app.session.tool_id(), "eyedropper");
|
||||
assert!(app.hold_keys.pending.is_none());
|
||||
keys.frame(&mut app, 5.0, vec![]);
|
||||
assert_eq!(fill(&app), "#ff0000", "nothing waits after it");
|
||||
}
|
||||
|
||||
/// Another key pressed after the delay has passed, before a frame ran the hold, runs the hold.
|
||||
#[test]
|
||||
fn an_overdue_wait_ended_by_another_key_runs_the_hold() {
|
||||
let mut app = erolka_x(true);
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::X, "x");
|
||||
keys.press(&mut app, 0.5, Key::V, "v");
|
||||
assert_eq!(fill(&app), "#0000ff", "the hold ran");
|
||||
assert_eq!(app.session.tool_id(), "selection", "then V");
|
||||
}
|
||||
|
||||
/// The window losing the keyboard ends the wait without running anything.
|
||||
#[test]
|
||||
fn losing_the_keyboard_ends_the_wait() {
|
||||
let mut app = erolka_x(true);
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::X, "x");
|
||||
keys.frame_with_focus(&mut app, 0.1, vec![], false);
|
||||
keys.frame(&mut app, 1.0, vec![]);
|
||||
assert_eq!(app.session.tool_id(), "pen");
|
||||
assert_eq!(fill(&app), "#ff0000");
|
||||
assert!(app.hold_keys.pending.is_none());
|
||||
}
|
||||
|
||||
/// Cmd, Ctrl or Alt pressed while a key waits ends the wait as a tap, before the chord runs.
|
||||
#[test]
|
||||
fn a_command_modifier_ends_the_wait_as_a_tap() {
|
||||
let mut app = erolka_x(true);
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::X, "x");
|
||||
keys.frame(&mut app, 0.1, vec![egui::Event::ModifiersChanged(Modifiers::COMMAND)]);
|
||||
assert_eq!(app.session.tool_id(), "eyedropper");
|
||||
keys.frame(&mut app, 1.0, vec![]);
|
||||
assert_eq!(fill(&app), "#ff0000", "nothing waits after it");
|
||||
}
|
||||
|
||||
/// A tool key with a hold shortcut runs the hold, and the tool is not chosen for the time the key
|
||||
/// is held (`holdToolKeys`); a quick press chooses the tool for good.
|
||||
#[test]
|
||||
fn a_hold_shortcut_takes_a_tool_key_from_hold_tool_keys() {
|
||||
let mut app = app_with(true);
|
||||
assert!(app.session.prefs.hold_tool_keys);
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "S"})).unwrap();
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::S, "s");
|
||||
keys.frame(&mut app, 0.4, vec![]);
|
||||
assert_eq!(fill(&app), "#0000ff", "the hold runs");
|
||||
assert_eq!(app.session.tool_id(), "pen", "Scale is not chosen while S is held");
|
||||
keys.release(&mut app, 1.0, Key::S);
|
||||
assert_eq!(app.session.tool_id(), "pen");
|
||||
keys.press(&mut app, 2.0, Key::S, "s");
|
||||
keys.release(&mut app, 2.1, Key::S);
|
||||
assert_eq!(app.session.tool_id(), "scale", "a quick press chooses Scale");
|
||||
keys.frame(&mut app, 3.0, vec![]);
|
||||
assert_eq!(app.session.tool_id(), "scale", "for good");
|
||||
assert!(app.held_tool.is_empty());
|
||||
}
|
||||
|
||||
/// A tool key without a hold shortcut still chooses its tool while held when another key has one.
|
||||
#[test]
|
||||
fn other_tool_keys_keep_hold_tool_keys() {
|
||||
let mut app = erolka_x(true);
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::S, "s");
|
||||
assert_eq!(app.session.tool_id(), "scale");
|
||||
keys.frame(&mut app, 1.0, vec![]);
|
||||
keys.release(&mut app, 1.1, Key::S);
|
||||
assert_eq!(app.session.tool_id(), "pen", "the Pen comes back");
|
||||
}
|
||||
|
||||
/// A hold on Shift and a digit recorded in the dialog (Shift+1) holds when the press types `!`.
|
||||
#[test]
|
||||
fn a_shifted_digit_holds_when_it_types_its_symbol() {
|
||||
let mut app = app_with(true);
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Shift+1"})).unwrap();
|
||||
let keys = Keyboard::new();
|
||||
keys.frame(&mut app, 0.0, press(Key::Num1, "!", Modifiers::SHIFT));
|
||||
keys.frame(&mut app, 0.4, vec![]);
|
||||
assert_eq!(fill(&app), "#0000ff");
|
||||
}
|
||||
|
||||
/// With one entry holding Shift+1 and another `!`, which Shift+1 types, holding Shift+1 runs the
|
||||
/// entry that holds the key itself.
|
||||
#[test]
|
||||
fn a_shifted_digit_holds_before_the_symbol_it_types() {
|
||||
let mut app = app_with(true);
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Shift+1"})).unwrap();
|
||||
app.run("shortcuts.set", json!({"id": "select.all", "hold": "!"})).unwrap();
|
||||
assert_eq!(app.ui.shortcut_holds.len(), 2);
|
||||
let keys = Keyboard::new();
|
||||
keys.frame(&mut app, 0.0, press(Key::Num1, "!", Modifiers::SHIFT));
|
||||
keys.frame(&mut app, 0.4, vec![]);
|
||||
assert_eq!(fill(&app), "#0000ff", "Shift+1's hold ran");
|
||||
}
|
||||
|
||||
/// A quick press of a shifted key with a hold shortcut runs what the key runs without one: a
|
||||
/// shortcut on Shift+. (typing `>`) runs, and Shift+1 (typing `!`) runs what `!` runs.
|
||||
#[test]
|
||||
fn a_quick_press_of_a_shifted_key_runs_what_it_runs_without_a_hold() {
|
||||
for (key, text, chord) in [(Key::Period, ">", "Shift+."), (Key::Num1, "!", "Shift+1")] {
|
||||
let mut app = app_with(true);
|
||||
app.run("shortcuts.set", json!({"id": "tool:eyedropper", "shortcut": chord, "force": true})).unwrap();
|
||||
let keys = Keyboard::new();
|
||||
keys.frame(&mut app, 0.0, press(key, text, Modifiers::SHIFT));
|
||||
keys.frame(&mut app, 0.05, vec![release(key)]);
|
||||
let without = app.session.tool_id().to_string();
|
||||
app.select_tool("pen");
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": chord})).unwrap();
|
||||
keys.frame(&mut app, 1.0, press(key, text, Modifiers::SHIFT));
|
||||
assert_eq!(app.session.tool_id(), "pen", "{chord} waits");
|
||||
keys.frame(&mut app, 1.05, vec![release(key)]);
|
||||
assert_eq!(app.session.tool_id(), without, "a quick press of {chord}");
|
||||
assert_eq!(fill(&app), "#ff0000");
|
||||
}
|
||||
}
|
||||
|
||||
/// The Shift+. shortcut runs on its press without a hold shortcut, and at the release of a quick
|
||||
/// press with one.
|
||||
#[test]
|
||||
fn a_quick_press_of_shift_period_runs_its_shortcut() {
|
||||
let mut app = app_with(true);
|
||||
app.run("shortcuts.set", json!({"id": "tool:eyedropper", "shortcut": "Shift+.", "force": true})).unwrap();
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Shift+."})).unwrap();
|
||||
let keys = Keyboard::new();
|
||||
keys.frame(&mut app, 0.0, press(Key::Period, ">", Modifiers::SHIFT));
|
||||
keys.frame(&mut app, 0.05, vec![release(Key::Period)]);
|
||||
assert_eq!(app.session.tool_id(), "eyedropper");
|
||||
}
|
||||
|
||||
/// A text with no key press that typed it does not wait: it has no key to let go.
|
||||
#[test]
|
||||
fn a_text_without_its_key_press_does_not_wait() {
|
||||
let mut app = erolka_x(true);
|
||||
let keys = Keyboard::new();
|
||||
keys.frame(&mut app, 0.0, vec![egui::Event::Text("x".into())]);
|
||||
assert!(app.hold_keys.pending.is_none());
|
||||
assert_eq!(app.session.tool_id(), "eyedropper", "it runs as a single-key shortcut, as before");
|
||||
}
|
||||
|
||||
/// A hold whose command opens a dialog holds back the key's repeats from it.
|
||||
#[test]
|
||||
fn a_hold_that_opens_a_dialog_keeps_the_repeats_from_it() {
|
||||
let mut app = app_with(true);
|
||||
app.run("shortcuts.set", json!({"id": "edit.preferences", "hold": "K"})).unwrap();
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::K, "k");
|
||||
keys.frame(&mut app, 0.4, vec![]);
|
||||
assert!(app.ui.dialog.is_some(), "the hold opened Preferences");
|
||||
let opening = keys.ctx.data(|m| m.get_temp::<Key>(super::super::opening_key_id(&keys.ctx)));
|
||||
assert_eq!(opening, Some(Key::K), "K is the key that opened it");
|
||||
keys.press(&mut app, 0.5, Key::K, "k");
|
||||
assert!(app.hold_keys.swallowed.iter().any(|s| s.key == Key::K), "K's repeats are held back until it is let go");
|
||||
// A repeat in the same frame as the release is held back too.
|
||||
let mut events = press(Key::K, "k", Modifiers::NONE);
|
||||
events.push(release(Key::K));
|
||||
let left = keys.frame_left(&mut app, 0.6, events);
|
||||
assert!(!left.iter().any(|e| matches!(e, egui::Event::Text(_) | egui::Event::Key { pressed: true, .. })), "{left:?}");
|
||||
assert!(app.hold_keys.swallowed.is_empty());
|
||||
}
|
||||
|
||||
/// A key that ends a wait whose tap opens a dialog does not reach the dialog: Enter does not
|
||||
/// confirm it.
|
||||
#[test]
|
||||
fn the_key_that_ends_a_wait_does_not_reach_the_dialog_it_opened() {
|
||||
let mut app = app_with(true);
|
||||
app.run("shortcuts.set", json!({"id": "edit.preferences", "shortcut": "K", "force": true})).unwrap();
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "K"})).unwrap();
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::K, "k");
|
||||
let enter = egui::Event::Key { key: Key::Enter, physical_key: Some(Key::Enter), pressed: true, repeat: false, modifiers: Modifiers::NONE };
|
||||
let left = keys.frame_left(&mut app, 0.1, vec![enter]);
|
||||
assert!(app.ui.dialog.is_some(), "the tap opened Preferences");
|
||||
assert!(!left.iter().any(|e| matches!(e, egui::Event::Key { key: Key::Enter, .. })), "{left:?}");
|
||||
assert_eq!(fill(&app), "#ff0000");
|
||||
}
|
||||
|
||||
/// A key typed before a wait that starts and ends in one frame, and that opens a dialog, keeps the
|
||||
/// frame's later keys from the dialog, the ones before the waiting key included.
|
||||
#[test]
|
||||
fn a_key_typed_before_a_wait_does_not_let_later_keys_reach_its_dialog() {
|
||||
let mut app = app_with(true);
|
||||
app.run("shortcuts.set", json!({"id": "edit.preferences", "shortcut": "D", "force": true})).unwrap();
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "X"})).unwrap();
|
||||
let keys = Keyboard::new();
|
||||
let mut events = press(Key::D, "d", Modifiers::NONE);
|
||||
events.extend(press(Key::A, "a", Modifiers::NONE));
|
||||
events.extend(press(Key::X, "x", Modifiers::NONE));
|
||||
events.push(release(Key::X));
|
||||
let left = keys.frame_left(&mut app, 0.0, events);
|
||||
assert!(app.ui.dialog.is_some(), "D opened Preferences");
|
||||
assert!(!left.iter().any(|e| matches!(e, egui::Event::Text(_) | egui::Event::Key { key: Key::A, pressed: true, .. })), "{left:?}");
|
||||
assert_eq!(fill(&app), "#ff0000");
|
||||
}
|
||||
|
||||
/// On the web build, where each press's text comes before it, a key typed before a wait that
|
||||
/// starts and ends in one frame, and that opens a dialog, keeps the frame's later keys from the
|
||||
/// dialog too.
|
||||
#[test]
|
||||
fn a_key_typed_before_a_wait_on_the_web_build_does_not_let_later_keys_reach_its_dialog() {
|
||||
let mut app = app_with(true);
|
||||
app.run("shortcuts.set", json!({"id": "edit.preferences", "shortcut": "D", "force": true})).unwrap();
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "X"})).unwrap();
|
||||
let keys = Keyboard::new();
|
||||
let web = |key: Key, text: &str| {
|
||||
[egui::Event::Text(text.into()), egui::Event::Key { key, physical_key: Some(key), pressed: true, repeat: false, modifiers: Modifiers::NONE }]
|
||||
};
|
||||
let mut events = vec![];
|
||||
for (key, text) in [(Key::D, "d"), (Key::A, "a"), (Key::X, "x")] {
|
||||
events.extend(web(key, text));
|
||||
}
|
||||
events.push(release(Key::X));
|
||||
let left = keys.frame_left(&mut app, 0.0, events);
|
||||
assert!(app.ui.dialog.is_some(), "D opened Preferences");
|
||||
assert!(!left.iter().any(|e| matches!(e, egui::Event::Text(_) | egui::Event::Key { pressed: true, .. })), "{left:?}");
|
||||
assert_eq!(fill(&app), "#ff0000");
|
||||
}
|
||||
|
||||
/// On the web build a press's text comes before it: the text of the key that ends such a wait
|
||||
/// does not reach the dialog either.
|
||||
#[test]
|
||||
fn the_text_before_the_key_that_ends_a_wait_does_not_reach_the_dialog() {
|
||||
let mut app = app_with(true);
|
||||
app.run("shortcuts.set", json!({"id": "edit.preferences", "shortcut": "K", "force": true})).unwrap();
|
||||
app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "K"})).unwrap();
|
||||
let keys = Keyboard::new();
|
||||
keys.press(&mut app, 0.0, Key::K, "k");
|
||||
let m = egui::Event::Key { key: Key::M, physical_key: Some(Key::M), pressed: true, repeat: false, modifiers: Modifiers::NONE };
|
||||
let left = keys.frame_left(&mut app, 0.1, vec![egui::Event::Text("m".into()), m]);
|
||||
assert!(app.ui.dialog.is_some(), "the tap opened Preferences");
|
||||
assert!(!left.iter().any(|e| matches!(e, egui::Event::Text(_) | egui::Event::Key { pressed: true, .. })), "{left:?}");
|
||||
}
|
||||
@@ -696,6 +696,12 @@ pub struct UiState {
|
||||
/// stored in the form every earlier version reads.
|
||||
#[serde(default, with = "crate::keymap::stored")]
|
||||
pub shortcut_overrides: craft_keymap::Overrides,
|
||||
/// Hold shortcuts: command id, `tool:<id>` or `panel:<id>` → a character key, alone or with
|
||||
/// Shift ("X", "Shift+X", "."). Holding the key for the Hold Shortcut Delay runs the entry; a
|
||||
/// quick press runs the key's own shortcut when it is let go. Kept apart from
|
||||
/// `shortcut_overrides`, so earlier versions read the settings without them.
|
||||
#[serde(default, skip_serializing_if = "std::collections::BTreeMap::is_empty")]
|
||||
pub shortcut_holds: std::collections::BTreeMap<String, String>,
|
||||
/// Name of the shortcut set (preset or "Custom").
|
||||
#[serde(default = "default_shortcut_set", deserialize_with = "crate::shortcut_editor::deserialize_set_name")]
|
||||
pub shortcut_set: String,
|
||||
@@ -1273,6 +1279,7 @@ impl Default for UiState {
|
||||
action_playback: Default::default(),
|
||||
action_playing: None,
|
||||
shortcut_overrides: Default::default(),
|
||||
shortcut_holds: Default::default(),
|
||||
shortcut_set: default_shortcut_set(),
|
||||
workspace: default_workspace(),
|
||||
touch_workspace_restore: None,
|
||||
|
||||
+33
-2
@@ -7235,6 +7235,36 @@ more after it, or that starts with a tab or a carriage return, starts with an ap
|
||||
{"name":"run_command","arguments":{"command":"shortcuts.exportText","params":{"path":"/Users/me/Shortcuts.pdf","format":"sheet","pageSize":"a4"}}}
|
||||
```
|
||||
|
||||
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). When one entry holds a key with
|
||||
Shift (Shift+1) and another the character it types (`!`), that key runs the hold shortcut of the first.
|
||||
|
||||
`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. A command the editor lists only while it has a shortcut (one that needs a value, such as
|
||||
`transparency.set`) takes a hold shortcut only with a shortcut, and loses its hold shortcut when its shortcut is cleared
|
||||
or given to another entry. `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
|
||||
@@ -7491,8 +7521,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
|
||||
|
||||
@@ -1421,6 +1421,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.
|
||||
A symbol dragged from one document's Symbols panel and dropped on the canvas after another document became active places the dragged symbol, not a symbol of the same name in the active document (`symbol.placeFromDocument`). VectorCraft's own rules: the symbol, the symbols it nests and the resources they use are added to the active document as a drop of art from the other document adds them, in the same undo step as the instance; a symbol the document already has with the same art and Symbol Options is used, and one with the same name but other art or options is added under a free name ("Leaf 2"); the chip at the pointer shows the dragged symbol; a symbol whose document was closed before the drop places nothing and the status bar shows the error. Tests: `canvas::tests::a_symbol_dragged_from_another_document_places_that_documents_symbol`, `a_symbol_whose_document_closed_places_nothing`, `the_pointer_chip_of_a_dragged_symbol_shows_its_own_documents_symbol`, `tests::symbollib::another_documents_symbol_is_added_and_placed_in_one_step`.
|
||||
|
||||
Reference in new issue
Block a user