Skip to content

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 ¤

begin(serial: int, time: int, surface: wl_surface, fingers: int) -> None

Multi-finger pinch begin

This event is sent when a multi-finger pinch gesture is detected on the device.

Parameters:

  • time ¤

    (int) –

    Timestamp with millisecond granularity

  • fingers ¤

    (int) –

    Number of fingers

update ¤

update(time: int, dx: float, dy: float, scale: float, rotation: float) -> None

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 ¤

end(serial: int, time: int, cancelled: int) -> None

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:

  • time ¤

    (int) –

    Timestamp with millisecond granularity

  • cancelled ¤

    (int) –

    1 if the gesture was cancelled, 0 otherwise

destroy ¤

destroy() -> None

Destroy the pinch gesture object

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 ¤

on_update(time: int, dx: float, dy: float, scale: float, rotation: float) -> None

Multi-finger pinch motion.

Override to handle wayland.zwp_pointer_gesture_pinch_v1.events.update.

on_end ¤

on_end(serial: int, time: int, cancelled: int) -> None

Multi-finger pinch end.

Override to handle wayland.zwp_pointer_gesture_pinch_v1.events.end.