zwp_pointer_gesture_pinch_v1¤
wayland.zwp_pointer_gesture_pinch_v1 ¤
A pinch gesture object
A pinch gesture object notifies a client about a multi-finger pinch gesture detected on an indirect input device such as a touchpad. The gesture is usually initiated by multiple fingers moving towards each other or away from each other, or by two or more fingers rotating around a logical center of gravity. The precise conditions of when such a gesture is detected are implementation-dependent.
A gesture consists of three stages: begin, update (optional) and end. There cannot be multiple simultaneous hold, pinch or swipe gestures on a same pointer/seat, how compositors prevent these situations is implementation-dependent.
A gesture may be cancelled by the compositor or the hardware. Clients should not consider performing permanent or irreversible actions until the end of a gesture has been received.
Methods:
-
destroy
–Destroy the pinch gesture object
-
on_begin
–Multi-finger pinch begin.
-
on_update
–Multi-finger pinch motion.
-
on_end
–Multi-finger pinch end.
events
begin ¤
update ¤
Multi-finger pinch motion
This event is sent when a multi-finger pinch gesture changes the position of the logical center, the rotation or the relative scale.
The dx and dy coordinates are relative coordinates in the surface coordinate space of the logical center of the gesture.
The scale factor is an absolute scale compared to the pointer_gesture_pinch.begin event, e.g. a scale of 2 means the fingers are now twice as far apart as on pointer_gesture_pinch.begin.
The rotation is the relative angle in degrees clockwise compared to the previous pointer_gesture_pinch.begin or pointer_gesture_pinch.update event.
Parameters:
-
time
¤int
) –Timestamp with millisecond granularity
-
dx
¤float
) –Delta x coordinate in surface coordinate space
-
dy
¤float
) –Delta y coordinate in surface coordinate space
-
scale
¤float
) –Scale relative to the initial finger position
-
rotation
¤float
) –Angle in degrees cw relative to the previous event
end ¤
Multi-finger pinch end
This event is sent when a multi-finger pinch gesture ceases to be valid. This may happen when one or more fingers are lifted or the gesture is cancelled.
When a gesture is cancelled, the client should undo state changes caused by this gesture. What causes a gesture to be cancelled is implementation-dependent.
Parameters:
on_begin ¤
on_begin(serial: int, time: int, surface: wl_surface, fingers: int) -> None
Multi-finger pinch begin.
Override to handle wayland.zwp_pointer_gesture_pinch_v1.events.begin
.
on_update ¤
Multi-finger pinch motion.
Override to handle wayland.zwp_pointer_gesture_pinch_v1.events.update
.
on_end ¤
Multi-finger pinch end.
Override to handle wayland.zwp_pointer_gesture_pinch_v1.events.end
.