Handling touchpad input

Godot Version

4.2.1

Question

im trying to process zoomin and zoomout event from the touchpad, but the one for mouse in godot does not work
this is how zoomin and zoomout on touchpad like⬇️

1 Like

You can try using InputEventMagnifyGesture but, as far as I can see, it’s only implemented on Android, macOS and Linux when using Wayland

maybe a bit late but I use InputEventMagnifyingGesture on the mac and its quite easy, tho it doesnt work on mobile so I gotta figure that out.

if event is InputEventMagnifyGesture:
camera.zoom = Vector2(1,1) * clamp(camera.zoom.x * event.factor, minZoom, maxZoom)