Skip to content

Conversation

@neftaly
Copy link
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
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