forked from 1b-agent/opencadstudio-upstream
feat(input): touch screen gestures on the drawing
One finger already worked as the mouse. Two or more fingers now make a gesture instead of fighting over the cursor: two drag to pan and pinch to zoom about the fingers, three drag to orbit; a quick two-finger tap opens the context menu, a three-finger tap zooms to the extents and a quick three-finger swipe up shows the isometric view. While a gesture runs the drawing area's own pointer handling keeps out, and the press the first finger started is dropped. Refs #906 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fcf1cedf52
commit
780b54489e
6 files changed
+339
No files matched your search
@@ -605,6 +605,7 @@ impl OpenCADStudio {
|
||||
match msg {
|
||||
Message::SpaceMouseWake => self.on_spacemouse_wake(),
|
||||
Message::TrackpadPinch(magnification) => self.on_pinch_zoom(magnification),
|
||||
Message::Touch(event) => self.on_touch(event),
|
||||
Message::SpaceMouseFrame(time) => {
|
||||
self.spacemouse
|
||||
.frame(time.saturating_duration_since(self.start).as_secs_f64() * 1000.);
|
||||
@@ -4343,6 +4344,18 @@ impl OpenCADStudio {
|
||||
// ── Cursor / viewport messages ─────────────────────────────────
|
||||
Message::CursorMoved(p, viewport) => self.on_cursor_moved(p, viewport),
|
||||
|
||||
// A multi-finger gesture owns the pointer while it runs.
|
||||
Message::ViewportMove(_)
|
||||
| Message::ViewportLeftPress
|
||||
| Message::ViewportLeftRelease
|
||||
| Message::PaneMove(..)
|
||||
| Message::PanePress(_)
|
||||
| Message::PaneRelease(_)
|
||||
if self.touch.active() =>
|
||||
{
|
||||
Task::none()
|
||||
}
|
||||
|
||||
Message::ViewportMove(p) => self.on_viewport_move(p),
|
||||
|
||||
Message::ViewportExit => self.on_viewport_exit(),
|
||||
|
||||
Reference in new issue
Block a user