engine icon indicating copy to clipboard operation
engine copied to clipboard

Make camera controls more sensitive to trackpad pinch

Open vincentwoo opened this issue 11 months ago • 4 comments

On browsers unfortunately trackpad pinch-zoom is sent over as a wheel event. However, the magnitude of these events are decidedly smaller in practice, leading to very unsatisfying pinch zooming. Multiplying deltas by 10 when they are less than 25 in my testing is an effective fix for this.

A more complete solution can be implemented by tracking the state of the ctrl key vs whether it was pressed beforehand in a separate keydown handler, but it is more onerous and this seems to work alright in the interim.

I confirm I have read the contributing guidelines and signed the Contributor License Agreement.

vincentwoo avatar Feb 13 '25 10:02 vincentwoo

I would be very hesitant to add such magical behaviour as people use different scroll speeds based on their OS's, and magical number of 25 and then 10 - might be unconsistent across various devices. Especially considering it will change behavior for existing projects.

What would be a better solution, is to detect what kind of input it is from the event, to differentiate between mouse/touch/touchpad, and then do a decision based on that. It requires a various testing across different platforms and devices. And perhaps for now you can do that decision on application level, instead of engine level.

Maksims avatar Feb 13 '25 16:02 Maksims

Yeah I think that is perfectly reasonable, but I also think this hack is quite easy to delete when you build the input differentiation system. Up to you!

vincentwoo avatar Feb 14 '25 00:02 vincentwoo

Hey @kpal81xd, this PR has been open for a few months now. Can you bring it to a conclusion when you have a moment please?

willeastcott avatar Jun 26 '25 08:06 willeastcott

Just bumping this again, @kpal81xd - can you make a call on what you want to do with this please?

willeastcott avatar Sep 30 '25 23:09 willeastcott