Skip to content

feat: improve MapHandles wheel/trackpad gestures#481

Draft
neftaly wants to merge 5 commits intopmndrs:mainfrom
neftaly:trackpad-gestures
Draft

feat: improve MapHandles wheel/trackpad gestures#481
neftaly wants to merge 5 commits intopmndrs:mainfrom
neftaly:trackpad-gestures

Conversation

@neftaly
Copy link
Copy Markdown
Contributor

@neftaly neftaly commented Dec 29, 2025

Adds trackpad gesture support for MapHandles:

  • 2-finger swipe horizontal → yaw (was non-functional)
  • Pinch → pitch
  • Shift + 2-finger swipe → pan
  • useDisableGestures hook to prevent browser pinch-zoom interference
  • MapHandlesWheelOptions to disable gestures (for legacy users with custom handlers, potentially a breaking change) or configure speeds
  • Playwright tests

See examples/map-handles for usage.

Notes

- Vertical scroll → zoom
- Horizontal scroll → yaw rotation
- Ctrl+scroll (pinch) → pitch
- Shift+scroll → pan

Adds MapHandlesWheelOptions to configure or disable each gesture.
Includes Playwright tests.

Note: Cannot distinguish mouse wheel from trackpad cross-browser,
so all wheel inputs are treated uniformly.
See: https://github.com/w3c/uievents/issues/337
Prevents browser pinch-zoom by intercepting ctrl+wheel events.
CSS import available: @react-three/handle/disable-gestures.css
@neftaly
Copy link
Copy Markdown
Contributor Author

neftaly commented Feb 4, 2026

I'm introducing a copy of the maphandles example in #491 (for an unrelated bugfix), this is on hold till that lands

@neftaly neftaly marked this pull request as draft February 4, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant