feat(input): expand shortcut support
This commit is contained in:
parent
4be8d9735c
commit
fb0f409bfd
3 changed files with 77 additions and 0 deletions
|
|
@ -12,12 +12,17 @@ ML, *MLINE
|
||||||
PL, *PLINE
|
PL, *PLINE
|
||||||
A, *ARC
|
A, *ARC
|
||||||
C, *CIRCLE
|
C, *CIRCLE
|
||||||
|
B, *BLOCK
|
||||||
|
I, *INSERT
|
||||||
DO, *DONUT
|
DO, *DONUT
|
||||||
EL, *ELLIPSE
|
EL, *ELLIPSE
|
||||||
PO, *POINT
|
PO, *POINT
|
||||||
SPL, *SPLINE
|
SPL, *SPLINE
|
||||||
H, *HATCH
|
H, *HATCH
|
||||||
|
BH, *HATCH
|
||||||
HE, *HATCHEDIT
|
HE, *HATCHEDIT
|
||||||
|
BO, *BOUNDARY
|
||||||
|
GD, *GRADIENT
|
||||||
XL, *XLINE
|
XL, *XLINE
|
||||||
POL, *POLYGON
|
POL, *POLYGON
|
||||||
REC, *RECT
|
REC, *RECT
|
||||||
|
|
@ -33,6 +38,7 @@ MI, *MIRROR
|
||||||
E, *ERASE
|
E, *ERASE
|
||||||
X, *EXPLODE
|
X, *EXPLODE
|
||||||
SS, *STRETCH
|
SS, *STRETCH
|
||||||
|
S, *STRETCH
|
||||||
O, *OFFSET
|
O, *OFFSET
|
||||||
TR, *TRIM
|
TR, *TRIM
|
||||||
EX, *EXTEND
|
EX, *EXTEND
|
||||||
|
|
@ -55,9 +61,13 @@ CX, *CUTCLIP
|
||||||
PC, *PASTECLIP
|
PC, *PASTECLIP
|
||||||
|
|
||||||
; ── Blocks / references ───────────────────────────────────────────────────
|
; ── Blocks / references ───────────────────────────────────────────────────
|
||||||
|
ATT, *ATTDEF
|
||||||
|
BE, *BEDIT
|
||||||
|
IAT, *IMAGEATTACH
|
||||||
XA, *XATTACH
|
XA, *XATTACH
|
||||||
XR, *XREF
|
XR, *XREF
|
||||||
ADC, *ADCENTER
|
ADC, *ADCENTER
|
||||||
|
W, *WBLOCK
|
||||||
|
|
||||||
; ── Layers / groups ───────────────────────────────────────────────────────
|
; ── Layers / groups ───────────────────────────────────────────────────────
|
||||||
LA, *LAYERS
|
LA, *LAYERS
|
||||||
|
|
@ -65,6 +75,7 @@ G, *GROUP
|
||||||
UG, *UNGROUP
|
UG, *UNGROUP
|
||||||
|
|
||||||
; ── Dimensions / annotation ───────────────────────────────────────────────
|
; ── Dimensions / annotation ───────────────────────────────────────────────
|
||||||
|
D, *DIMSTYLE
|
||||||
DAL, *DIMALIGNED
|
DAL, *DIMALIGNED
|
||||||
DAN, *DIMANGULAR
|
DAN, *DIMANGULAR
|
||||||
DDI, *DIMDIAMETER
|
DDI, *DIMDIAMETER
|
||||||
|
|
@ -77,6 +88,7 @@ DED, *DIMEDIT
|
||||||
DBR, *DIMBREAK
|
DBR, *DIMBREAK
|
||||||
DJL, *DIMJOGLINE
|
DJL, *DIMJOGLINE
|
||||||
DJO, *DIMJOGGED
|
DJO, *DIMJOGGED
|
||||||
|
JOG, *DIMJOGGED
|
||||||
DCE, *DIMCENTER
|
DCE, *DIMCENTER
|
||||||
LE, *LEADER
|
LE, *LEADER
|
||||||
QL, *QLEADER
|
QL, *QLEADER
|
||||||
|
|
@ -85,11 +97,14 @@ MLA, *MLEADERADD
|
||||||
MLR, *MLEADERREMOVE
|
MLR, *MLEADERREMOVE
|
||||||
MLAL, *MLEADERALIGN
|
MLAL, *MLEADERALIGN
|
||||||
MLC, *MLEADERCOLLECT
|
MLC, *MLEADERCOLLECT
|
||||||
|
MLS, *MLEADERSTYLE
|
||||||
MT, *MTEXT
|
MT, *MTEXT
|
||||||
DT, *TEXT
|
DT, *TEXT
|
||||||
T, *TEXT
|
T, *TEXT
|
||||||
ED, *DDEDIT
|
ED, *DDEDIT
|
||||||
TOL, *TOLERANCE
|
TOL, *TOLERANCE
|
||||||
|
TB, *TABLE
|
||||||
|
ST, *STYLE
|
||||||
|
|
||||||
; ── Inquiry / selection ───────────────────────────────────────────────────
|
; ── Inquiry / selection ───────────────────────────────────────────────────
|
||||||
AA, *AREA
|
AA, *AREA
|
||||||
|
|
@ -107,18 +122,56 @@ FI, *FILTER
|
||||||
P, *PAN
|
P, *PAN
|
||||||
U, *UNDO
|
U, *UNDO
|
||||||
PR, *PROPERTIES
|
PR, *PROPERTIES
|
||||||
|
CH, *PROPERTIES
|
||||||
|
MO, *PROPERTIES
|
||||||
UN, *UNITS
|
UN, *UNITS
|
||||||
TP, *TOOLPALETTES
|
TP, *TOOLPALETTES
|
||||||
SSM, *SHEETSET
|
SSM, *SHEETSET
|
||||||
VW, *WIREFRAME
|
VW, *WIREFRAME
|
||||||
HI, *HIDE
|
HI, *HIDE
|
||||||
3O, *3DORBIT
|
3O, *3DORBIT
|
||||||
|
ORBIT, *3DORBIT
|
||||||
MV, *MVIEW
|
MV, *MVIEW
|
||||||
MS, *MSPACE
|
MS, *MSPACE
|
||||||
|
PS, *PSPACE
|
||||||
PW, *PLOTWINDOW
|
PW, *PLOTWINDOW
|
||||||
QP, *QUICKPRINT
|
QP, *QUICKPRINT
|
||||||
|
V, *VIEW
|
||||||
|
VSM, *VISUALSTYLES
|
||||||
|
CUBE, *NAVVCUBE
|
||||||
|
FSHOT, *FLATSHOT
|
||||||
|
SHA, *SHADEMODE
|
||||||
|
|
||||||
|
; ── Settings / properties
|
||||||
|
COL, *COLOR
|
||||||
|
DR, *DRAWORDER
|
||||||
|
DS, *DSETTINGS
|
||||||
|
LT, *LINETYPE
|
||||||
|
LTS, *LTSCALE
|
||||||
|
OS, *OSNAP
|
||||||
|
PU, *PURGE
|
||||||
|
REN, *RENAME
|
||||||
|
SET, *SETVAR
|
||||||
|
SN, *SNAP
|
||||||
|
TH, *THICKNESS
|
||||||
|
UNHIDE, *UNISOLATEOBJECTS
|
||||||
|
|
||||||
|
; ── File / data
|
||||||
|
DL, *DATALINK
|
||||||
|
DX, *DATAEXTRACTION
|
||||||
|
EPDF, *EXPORTPDF
|
||||||
|
EXP, *EXPORT
|
||||||
|
ZIP, *ETRANSMIT
|
||||||
|
|
||||||
; ── 3D solids ─────────────────────────────────────────────────────────────
|
; ── 3D solids ─────────────────────────────────────────────────────────────
|
||||||
EXT, *EXTRUDE
|
EXT, *EXTRUDE
|
||||||
REV, *REVOLVE
|
REV, *REVOLVE
|
||||||
INF, *INTERFERE
|
INF, *INTERFERE
|
||||||
|
CYL, *CYLINDER
|
||||||
|
IN, *INTERSECT
|
||||||
|
PSOLID, *POLYSOLID
|
||||||
|
SEC, *SECTION
|
||||||
|
SU, *SUBTRACT
|
||||||
|
TOR, *TORUS
|
||||||
|
UNI, *UNION
|
||||||
|
WE, *WEDGE
|
||||||
|
|
|
||||||
|
|
@ -1935,6 +1935,12 @@ impl OpenCADStudio {
|
||||||
{
|
{
|
||||||
Some(Message::MTextCaretMove(1))
|
Some(Message::MTextCaretMove(1))
|
||||||
}
|
}
|
||||||
|
keyboard::Key::Named(keyboard::key::Named::F1) => {
|
||||||
|
Some(Message::Command("HELP".to_string()))
|
||||||
|
}
|
||||||
|
keyboard::Key::Named(keyboard::key::Named::F2) => {
|
||||||
|
Some(Message::CommandHistoryToggle)
|
||||||
|
}
|
||||||
keyboard::Key::Named(keyboard::key::Named::F3) => {
|
keyboard::Key::Named(keyboard::key::Named::F3) => {
|
||||||
Some(Message::ToggleSnapEnabled)
|
Some(Message::ToggleSnapEnabled)
|
||||||
}
|
}
|
||||||
|
|
@ -1957,8 +1963,12 @@ impl OpenCADStudio {
|
||||||
Some(Message::ToggleDynInput)
|
Some(Message::ToggleDynInput)
|
||||||
}
|
}
|
||||||
keyboard::Key::Character(c) if accel => match c.as_str() {
|
keyboard::Key::Character(c) if accel => match c.as_str() {
|
||||||
|
"0" => Some(Message::ToggleCleanScreen),
|
||||||
|
"1" => Some(Message::ToggleProperties),
|
||||||
"n" => Some(Message::TabNew),
|
"n" => Some(Message::TabNew),
|
||||||
"o" => Some(Message::OpenFile),
|
"o" => Some(Message::OpenFile),
|
||||||
|
"p" => Some(Message::Command("PLOT".to_string())),
|
||||||
|
"q" => Some(Message::Command("QUIT".to_string())),
|
||||||
"s" if !shift => Some(Message::SaveFile),
|
"s" if !shift => Some(Message::SaveFile),
|
||||||
"s" if shift => Some(Message::SaveAs),
|
"s" if shift => Some(Message::SaveAs),
|
||||||
"z" if !shift => Some(Message::Undo),
|
"z" if !shift => Some(Message::Undo),
|
||||||
|
|
@ -1979,12 +1989,18 @@ impl OpenCADStudio {
|
||||||
// fire the drawing's COPYCLIP/CUTCLIP/paste.
|
// fire the drawing's COPYCLIP/CUTCLIP/paste.
|
||||||
// Only when nothing captured (the drawing has
|
// Only when nothing captured (the drawing has
|
||||||
// focus, status Ignored) do these run. (#232)
|
// focus, status Ignored) do these run. (#232)
|
||||||
|
"c" if shift && status == Status::Ignored => {
|
||||||
|
Some(Message::Command("COPYBASE".to_string()))
|
||||||
|
}
|
||||||
"c" if status == Status::Ignored => {
|
"c" if status == Status::Ignored => {
|
||||||
Some(Message::Command("COPYCLIP".to_string()))
|
Some(Message::Command("COPYCLIP".to_string()))
|
||||||
}
|
}
|
||||||
"x" if status == Status::Ignored => {
|
"x" if status == Status::Ignored => {
|
||||||
Some(Message::Command("CUTCLIP".to_string()))
|
Some(Message::Command("CUTCLIP".to_string()))
|
||||||
}
|
}
|
||||||
|
"v" if shift && status == Status::Ignored => {
|
||||||
|
Some(Message::Command("PASTEBLOCK".to_string()))
|
||||||
|
}
|
||||||
"v" if status == Status::Ignored => Some(Message::PasteShortcut),
|
"v" if status == Status::Ignored => Some(Message::PasteShortcut),
|
||||||
// Web: a focused text field captured Ctrl+C/V,
|
// Web: a focused text field captured Ctrl+C/V,
|
||||||
// but iced's clipboard is a no-op there — route
|
// but iced's clipboard is a no-op there — route
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,8 @@ pub fn view_window<'a>(
|
||||||
// ── Shortcut entries ──────────────────────────────────────────────────
|
// ── Shortcut entries ──────────────────────────────────────────────────
|
||||||
let mut rows: Vec<Element<'_, Message>> = vec![
|
let mut rows: Vec<Element<'_, Message>> = vec![
|
||||||
section(t!("── Function Keys ──────────────────────────────────────")),
|
section(t!("── Function Keys ──────────────────────────────────────")),
|
||||||
|
shortcut_row("F1", t!("Help")),
|
||||||
|
shortcut_row("F2", t!("Toggle Command History")),
|
||||||
shortcut_row("F3", t!("Toggle Object Snap")),
|
shortcut_row("F3", t!("Toggle Object Snap")),
|
||||||
shortcut_row("F7", t!("Toggle Grid")),
|
shortcut_row("F7", t!("Toggle Grid")),
|
||||||
shortcut_row("F8", t!("Toggle Ortho")),
|
shortcut_row("F8", t!("Toggle Ortho")),
|
||||||
|
|
@ -105,16 +107,22 @@ pub fn view_window<'a>(
|
||||||
"── %{MOD} Shortcuts ──────────────────────────────────────",
|
"── %{MOD} Shortcuts ──────────────────────────────────────",
|
||||||
MOD = MOD
|
MOD = MOD
|
||||||
)),
|
)),
|
||||||
|
shortcut_row(format!("{MOD}+0"), t!("Clean Screen")),
|
||||||
|
shortcut_row(format!("{MOD}+1"), t!("Properties")),
|
||||||
shortcut_row(format!("{MOD}+N"), t!("New Drawing")),
|
shortcut_row(format!("{MOD}+N"), t!("New Drawing")),
|
||||||
shortcut_row(format!("{MOD}+O"), t!("Open File")),
|
shortcut_row(format!("{MOD}+O"), t!("Open File")),
|
||||||
|
shortcut_row(format!("{MOD}+P"), t!("Plot")),
|
||||||
|
shortcut_row(format!("{MOD}+Q"), t!("Close")),
|
||||||
shortcut_row(format!("{MOD}+S"), t!("Save")),
|
shortcut_row(format!("{MOD}+S"), t!("Save")),
|
||||||
shortcut_row(format!("{MOD}+Shift+S"), t!("Save As")),
|
shortcut_row(format!("{MOD}+Shift+S"), t!("Save As")),
|
||||||
shortcut_row(format!("{MOD}+Z"), t!("Undo")),
|
shortcut_row(format!("{MOD}+Z"), t!("Undo")),
|
||||||
shortcut_row(format!("{MOD}+Shift+Z / {MOD}+Y"), t!("Redo")),
|
shortcut_row(format!("{MOD}+Shift+Z / {MOD}+Y"), t!("Redo")),
|
||||||
shortcut_row(format!("{MOD}+F / {MOD}+H"), t!("Find and Replace")),
|
shortcut_row(format!("{MOD}+F / {MOD}+H"), t!("Find and Replace")),
|
||||||
shortcut_row(format!("{MOD}+C"), t!("Copy to Clipboard")),
|
shortcut_row(format!("{MOD}+C"), t!("Copy to Clipboard")),
|
||||||
|
shortcut_row(format!("{MOD}+Shift+C"), t!("Copy with Base Point")),
|
||||||
shortcut_row(format!("{MOD}+X"), t!("Cut to Clipboard")),
|
shortcut_row(format!("{MOD}+X"), t!("Cut to Clipboard")),
|
||||||
shortcut_row(format!("{MOD}+V"), t!("Paste from Clipboard")),
|
shortcut_row(format!("{MOD}+V"), t!("Paste from Clipboard")),
|
||||||
|
shortcut_row(format!("{MOD}+Shift+V"), t!("Paste as Block")),
|
||||||
section(t!("── Other Keys ──────────────────────────────────────────")),
|
section(t!("── Other Keys ──────────────────────────────────────────")),
|
||||||
shortcut_row("Enter / Space", t!("Finalize command / Repeat last")),
|
shortcut_row("Enter / Space", t!("Finalize command / Repeat last")),
|
||||||
shortcut_row("Escape", t!("Cancel active command")),
|
shortcut_row("Escape", t!("Cancel active command")),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue