playcanvas / playcanvas/engine
Improve trackpad pinch-zoom sensitivity in camera controls
Open
@kpal81xd is already working on this.
Since Mar 17, 2026.
enhancement
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
Summary
Trackpad pinch-zoom events are sent as wheel events in browsers, but their deltas are significantly smaller than mouse wheel events. This results in unsatisfying pinch-zoom behavior in camera-controls.mjs.
Required Changes
- Detect input type (mouse wheel vs trackpad pinch) from the wheel event rather than relying on arbitrary delta thresholds
- Apply appropriate sensitivity scaling based on the detected input type
- Test across different platforms, devices, and OS scroll speed settings to ensure consistent behavior
Context
This was identified in #7348. The proposed fix there used a magic number threshold (< 25) and a 10x multiplier, which would be inconsistent across devices and OS scroll speed settings. A proper solution should differentiate input types and handle them accordingly.
References
- Original PR: #7348
- File:
scripts/esm/camera-controls.mjs
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.