forked from 1b-agent/opencadstudio-upstream
feat(input): expand shortcut support
This commit is contained in:
1 parent
4be8d9735c
commit
fb0f409bfd
3 files changed
+77
No files matched your search
@@ -12,12 +12,17 @@ ML, *MLINE
|
||||
PL, *PLINE
|
||||
A, *ARC
|
||||
C, *CIRCLE
|
||||
B, *BLOCK
|
||||
I, *INSERT
|
||||
DO, *DONUT
|
||||
EL, *ELLIPSE
|
||||
PO, *POINT
|
||||
SPL, *SPLINE
|
||||
H, *HATCH
|
||||
BH, *HATCH
|
||||
HE, *HATCHEDIT
|
||||
BO, *BOUNDARY
|
||||
GD, *GRADIENT
|
||||
XL, *XLINE
|
||||
POL, *POLYGON
|
||||
REC, *RECT
|
||||
@@ -33,6 +38,7 @@ MI, *MIRROR
|
||||
E, *ERASE
|
||||
X, *EXPLODE
|
||||
SS, *STRETCH
|
||||
S, *STRETCH
|
||||
O, *OFFSET
|
||||
TR, *TRIM
|
||||
EX, *EXTEND
|
||||
@@ -55,9 +61,13 @@ CX, *CUTCLIP
|
||||
PC, *PASTECLIP
|
||||
|
||||
; ── Blocks / references ───────────────────────────────────────────────────
|
||||
ATT, *ATTDEF
|
||||
BE, *BEDIT
|
||||
IAT, *IMAGEATTACH
|
||||
XA, *XATTACH
|
||||
XR, *XREF
|
||||
ADC, *ADCENTER
|
||||
W, *WBLOCK
|
||||
|
||||
; ── Layers / groups ───────────────────────────────────────────────────────
|
||||
LA, *LAYERS
|
||||
@@ -65,6 +75,7 @@ G, *GROUP
|
||||
UG, *UNGROUP
|
||||
|
||||
; ── Dimensions / annotation ───────────────────────────────────────────────
|
||||
D, *DIMSTYLE
|
||||
DAL, *DIMALIGNED
|
||||
DAN, *DIMANGULAR
|
||||
DDI, *DIMDIAMETER
|
||||
@@ -77,6 +88,7 @@ DED, *DIMEDIT
|
||||
DBR, *DIMBREAK
|
||||
DJL, *DIMJOGLINE
|
||||
DJO, *DIMJOGGED
|
||||
JOG, *DIMJOGGED
|
||||
DCE, *DIMCENTER
|
||||
LE, *LEADER
|
||||
QL, *QLEADER
|
||||
@@ -85,11 +97,14 @@ MLA, *MLEADERADD
|
||||
MLR, *MLEADERREMOVE
|
||||
MLAL, *MLEADERALIGN
|
||||
MLC, *MLEADERCOLLECT
|
||||
MLS, *MLEADERSTYLE
|
||||
MT, *MTEXT
|
||||
DT, *TEXT
|
||||
T, *TEXT
|
||||
ED, *DDEDIT
|
||||
TOL, *TOLERANCE
|
||||
TB, *TABLE
|
||||
ST, *STYLE
|
||||
|
||||
; ── Inquiry / selection ───────────────────────────────────────────────────
|
||||
AA, *AREA
|
||||
@@ -107,18 +122,56 @@ FI, *FILTER
|
||||
P, *PAN
|
||||
U, *UNDO
|
||||
PR, *PROPERTIES
|
||||
CH, *PROPERTIES
|
||||
MO, *PROPERTIES
|
||||
UN, *UNITS
|
||||
TP, *TOOLPALETTES
|
||||
SSM, *SHEETSET
|
||||
VW, *WIREFRAME
|
||||
HI, *HIDE
|
||||
3O, *3DORBIT
|
||||
ORBIT, *3DORBIT
|
||||
MV, *MVIEW
|
||||
MS, *MSPACE
|
||||
PS, *PSPACE
|
||||
PW, *PLOTWINDOW
|
||||
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 ─────────────────────────────────────────────────────────────
|
||||
EXT, *EXTRUDE
|
||||
REV, *REVOLVE
|
||||
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))
|
||||
}
|
||||
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) => {
|
||||
Some(Message::ToggleSnapEnabled)
|
||||
}
|
||||
@@ -1957,8 +1963,12 @@ impl OpenCADStudio {
|
||||
Some(Message::ToggleDynInput)
|
||||
}
|
||||
keyboard::Key::Character(c) if accel => match c.as_str() {
|
||||
"0" => Some(Message::ToggleCleanScreen),
|
||||
"1" => Some(Message::ToggleProperties),
|
||||
"n" => Some(Message::TabNew),
|
||||
"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::SaveAs),
|
||||
"z" if !shift => Some(Message::Undo),
|
||||
@@ -1979,12 +1989,18 @@ impl OpenCADStudio {
|
||||
// fire the drawing's COPYCLIP/CUTCLIP/paste.
|
||||
// Only when nothing captured (the drawing has
|
||||
// focus, status Ignored) do these run. (#232)
|
||||
"c" if shift && status == Status::Ignored => {
|
||||
Some(Message::Command("COPYBASE".to_string()))
|
||||
}
|
||||
"c" if status == Status::Ignored => {
|
||||
Some(Message::Command("COPYCLIP".to_string()))
|
||||
}
|
||||
"x" if status == Status::Ignored => {
|
||||
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),
|
||||
// Web: a focused text field captured Ctrl+C/V,
|
||||
// but iced's clipboard is a no-op there — route
|
||||
|
||||
@@ -94,6 +94,8 @@ pub fn view_window<'a>(
|
||||
// ── Shortcut entries ──────────────────────────────────────────────────
|
||||
let mut rows: Vec<Element<'_, Message>> = vec![
|
||||
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("F7", t!("Toggle Grid")),
|
||||
shortcut_row("F8", t!("Toggle Ortho")),
|
||||
@@ -105,16 +107,22 @@ pub fn view_window<'a>(
|
||||
"── %{MOD} Shortcuts ──────────────────────────────────────",
|
||||
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}+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}+Shift+S"), t!("Save As")),
|
||||
shortcut_row(format!("{MOD}+Z"), t!("Undo")),
|
||||
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}+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}+V"), t!("Paste from Clipboard")),
|
||||
shortcut_row(format!("{MOD}+Shift+V"), t!("Paste as Block")),
|
||||
section(t!("── Other Keys ──────────────────────────────────────────")),
|
||||
shortcut_row("Enter / Space", t!("Finalize command / Repeat last")),
|
||||
shortcut_row("Escape", t!("Cancel active command")),
|
||||
|
||||
Reference in new issue
Block a user