feat(viewport): RMB=Enter option + timed right-click

Adds a configurable right-mouse-button behavior without disturbing orbit
or the context menu.

- New persisted setting `rmb_enter` (command `RMBENTER [ON|OFF]`, default
  off): when on, a right-click while a command is active acts as Enter
  (commit/close); when idle it still opens the context menu. Right-drag
  always orbits, so nothing is lost.
- Right-click vs orbit is now time-based: orbit engages only after the
  button is held >=150ms and the pointer moves, so a quick right-click is
  no longer swallowed by slight pointer jitter (was an 8px distance gate).
- The right-click Repeat menu now lists commands from every source
  (command line, ribbon, context menu, shortcuts) via a unified
  recents list recorded at the dispatch choke point, instead of only
  typed commands.

Closes #185

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-27 16:16:08 +03:00
1 parent 63de137106
commit 098585bb2d
10 files changed
+160 -56

No files matched your search

+4
View File
@@ -247,6 +247,9 @@ pub(super) struct OpenCADStudio {
dyn_input: bool,
/// Controls whether the TEXTEDIT command repeats automatically (0 = Multiple, 1 = Single).
pub texteditmode: bool,
/// When true, a viewport right-click acts as Enter while a command is active
/// (idle right-click still opens the context menu). Toggled by `RMBENTER`.
pub rmb_enter: bool,
/// Persisted default viewport background, restored from settings and applied
/// to every drawing tab (new and opened) so a chosen background survives
/// restarts (#188). `None` = the built-in dark-grey / off-white defaults.
@@ -1823,6 +1826,7 @@ impl OpenCADStudio {
show_grid: false,
dyn_input: true,
texteditmode: false,
rmb_enter: false,
default_bg_color: None,
default_paper_bg_color: None,
awaiting_vports: false,