Module Pointer_constraints_unstable_v1_client.Zwp_pointer_constraints_v1

Constrain the movement of a pointer.

The global interface exposing pointer constraining functionality. It exposes two requests: lock_pointer for locking the pointer to its position, and confine_pointer for locking the pointer to a region.

The lock_pointer and confine_pointer requests create the objects wp_locked_pointer and wp_confined_pointer respectively, and the client can use these objects to interact with the lock.

For any surface, only one lock or confinement may be active across all wl_pointer objects of the same seat. If a lock or confinement is requested when another lock or confinement is active or requested on the same surface and with any of the wl_pointer objects of the same seat, an 'already_constrained' error will be raised.

type 'v t = ([ `Zwp_pointer_constraints_v1 ], 'v, [ `Client ]) Wayland.Proxy.t

Version 1

val confine_pointer : [< `V1 ] as 'a t -> [[ `Zwp_confined_pointer_v1 ], 'b, [ `Client ]] Wayland.Proxy.Handler.t -> surface:([ `Wl_surface ], 'c, [ `Client ]) Wayland.Proxy.t -> pointer:([ `Wl_pointer ], 'd, [ `Client ]) Wayland.Proxy.t -> region:([ `Wl_region ], 'e, [ `Client ]) Wayland.Proxy.t option -> lifetime:{Imports}1.Zwp_pointer_constraints_v1.Lifetime.t -> ([ `Zwp_confined_pointer_v1 ], 'f, [ `Client ]) Wayland.Proxy.t

Confine pointer to a region.

The confine_pointer request lets the client request to confine the pointer cursor to a given region. This request may not take effect immediately; in the future, when the compositor deems implementation- specific constraints are satisfied, the pointer confinement will be activated and the compositor sends a confined event.

The intersection of the region passed with this request and the input region of the surface is used to determine where the pointer must be in order for the confinement to activate. It is up to the compositor whether to warp the pointer or require some kind of user interaction for the confinement to activate. If the region is null the surface input region is used.

The request will create a new object wp_confined_pointer which is used to interact with the confinement as well as receive updates about its state. See the the description of wp_confined_pointer for further information.

val lock_pointer : [< `V1 ] as 'a t -> [[ `Zwp_locked_pointer_v1 ], 'b, [ `Client ]] Wayland.Proxy.Handler.t -> surface:([ `Wl_surface ], 'c, [ `Client ]) Wayland.Proxy.t -> pointer:([ `Wl_pointer ], 'd, [ `Client ]) Wayland.Proxy.t -> region:([ `Wl_region ], 'e, [ `Client ]) Wayland.Proxy.t option -> lifetime:{Imports}1.Zwp_pointer_constraints_v1.Lifetime.t -> ([ `Zwp_locked_pointer_v1 ], 'f, [ `Client ]) Wayland.Proxy.t

Lock pointer to a position.

The lock_pointer request lets the client request to disable movements of the virtual pointer (i.e. the cursor), effectively locking the pointer to a position. This request may not take effect immediately; in the future, when the compositor deems implementation-specific constraints are satisfied, the pointer lock will be activated and the compositor sends a locked event.

The protocol provides no guarantee that the constraints are ever satisfied, and does not require the compositor to send an error if the constraints cannot ever be satisfied. It is thus possible to request a lock that will never activate.

There may not be another pointer constraint of any kind requested or active on the surface for any of the wl_pointer objects of the seat of the passed pointer when requesting a lock. If there is, an error will be raised. See general pointer lock documentation for more details.

The intersection of the region passed with this request and the input region of the surface is used to determine where the pointer must be in order for the lock to activate. It is up to the compositor whether to warp the pointer or require some kind of user interaction for the lock to activate. If the region is null the surface input region is used.

A surface may receive pointer focus without the lock being activated.

The request creates a new object wp_locked_pointer which is used to interact with the lock as well as receive updates about its state. See the the description of wp_locked_pointer for further information.

Note that while a pointer is locked, the wl_pointer objects of the corresponding seat will not emit any wl_pointer.motion events, but relative motion events will still be emitted via wp_relative_pointer objects of the same seat. wl_pointer.axis and wl_pointer.button events are unaffected.

val destroy : [< `V1 ] t -> unit

Destroy the pointer constraints manager object.

Used by the client to notify the server that it will no longer use this pointer constraints object.

Handlers

Note: Servers will always want to use v1.

class +'a v1 : object ... end

Handler for a proxy with version >= 1.