Skip to content

zwp_pointer_gesture_swipe_v1¤

wayland.zwp_pointer_gesture_swipe_v1 ¤

A swipe gesture object

A swipe gesture object notifies a client about a multi-finger swipe gesture detected on an indirect input device such as a touchpad. The gesture is usually initiated by multiple fingers moving in the same direction but once initiated the direction may change. 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 pointer swipe gesture object

  • on_begin

    Multi-finger swipe begin.

  • on_update

    Multi-finger swipe motion.

  • on_end

    Multi-finger swipe end.

events

begin ¤

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

Multi-finger swipe begin

This event is sent when a multi-finger swipe 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) -> None

Multi-finger swipe motion

This event is sent when a multi-finger swipe gesture changes the position of the logical center.

The dx and dy coordinates are relative coordinates of the logical center of the gesture compared to the previous 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

end ¤

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

Multi-finger swipe end

This event is sent when a multi-finger swipe 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 pointer swipe gesture object

on_begin ¤

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

Multi-finger swipe begin.

Override to handle wayland.zwp_pointer_gesture_swipe_v1.events.begin.

on_update ¤

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

Multi-finger swipe motion.

Override to handle wayland.zwp_pointer_gesture_swipe_v1.events.update.

on_end ¤

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

Multi-finger swipe end.

Override to handle wayland.zwp_pointer_gesture_swipe_v1.events.end.