wayland::pointer_t(3)
π
wayland::pointer_t(3) π
okay bestie, welcome to the Wayland++ manual page for wayland::pointer_t β pointer input device. Itβs giving mouse/pointer energy, and weβre getting through every detail together. π±οΈβ¨
β¨ NAME β¨
wayland::pointer_t β pointer input device. Thatβs the whole vibe: itβs the pointer input device wrapper. π«Ά
πΈ SYNOPSIS πΈ
#include <wayland-client-protocol.hpp>
Inherits wayland::proxy_t. π
π Public Types π
enum class wrapper_type { standard, display, foreign, proxy_wrapper }β the wrapper-type enum; full details are down below, no skipping. π
π οΈ Public Member Functions π οΈ
void set_cursor (uint32_t serial, surface_t const &surface, int32_t hotspot_x, int32_t hotspot_y)β set the pointer surface. π±οΈvoid release ()β release the pointer object. πbool can_release () constβ Check whether thereleasefunction is available with the currently bound version of the protocol. π¦std::function< void(uint32_t, surface_t, double, double)> & on_enter ()β enter event. πΈstd::function< void(uint32_t, surface_t)> & on_leave ()β leave event. πstd::function< void(uint32_t, double, double)> & on_motion ()β pointer motion event. πstd::function< void(uint32_t, uint32_t, uint32_t, pointer_button_state)> & on_button ()β pointer button event. πstd::function< void(uint32_t, pointer_axis, double)> & on_axis ()β axis event. πstd::function< void()> & on_frame ()β end of a pointer event sequence. π¬std::function< void(pointer_axis_source)> & on_axis_source ()β axis source event. πstd::function< void(uint32_t, pointer_axis)> & on_axis_stop ()β axis stop event. πstd::function< void(pointer_axis, int32_t)> & on_axis_discrete ()β axis click event. π±οΈstd::function< void(pointer_axis, int32_t)> & on_axis_value120 ()β axis high-resolution scroll event. π₯uint32_t get_id () constβ Get the id of a proxy object. πͺͺstd::string get_class () constβ Get the interface name (class) of a proxy object. π·οΈuint32_t get_version () constβ Get the protocol object version of a proxy object. π’wrapper_type get_wrapper_type () constβ Get the type of a proxy object. π§¬void set_queue (event_queue_t queue)β Assign a proxy to an event queue. π₯wl_proxy * c_ptr () constβ Get a pointer to the underlying C struct. π§·bool proxy_has_object () constβ Check whether this wrapper actually wraps an object. βoperator bool () constβ Check whether this wrapper actually wraps an object. πbool operator== (const proxy_t &right) constβ Check whether two wrappers refer to the same object. π«Άbool operator!= (const proxy_t &right) constβ Check whether two wrappers refer to different objects. πvoid proxy_release ()β Release the wrapped object (if any), making this an empty wrapper. π§Ή
π Static Public Attributes π
static constexpr std::uint32_t set_cursor_since_version = 1β Minimum protocol version required for theset_cursorfunction. βstatic constexpr std::uint32_t release_since_version = 3β Minimum protocol version required for thereleasefunction. π
π¦ Detailed Description π¦
pointer input device. π±οΈπ
The wl_pointer interface represents one or more input devices, such as mice, which control the pointer location and pointer_focus of a seat. πβ¨
The wl_pointer interface generates motion, enter and leave events for the surfaces that the pointer is located over, and button and axis events for button presses, button releases and scrolling. no cap, thatβs the whole pointer pipeline. π₯
Examples: egl.cpp.
Definition at line 2689 of file wayland-client-protocol.hpp.
𧬠Member Enumeration Documentation π§¬
enum class wayland::proxy_t::wrapper_type [strong], [inherited]
Underlying wl_proxy type and properties of a proxy_t that affect construction, destruction, and event handling. π§
Enumerator
standardβ C pointer is a standard type compatible withwl_proxy*. Events are dispatched and it is destructed when theproxy_tis destructed. User data is set. βdisplayβ C pointer is awl_display*. No events are dispatched,wl_display_disconnectis called when theproxy_tis destructed. User data is set. π₯οΈforeignβ C pointer is a standard type compatible withwl_proxy*, but another library owns it and it should not be touched in a way that could affect the operation of the other library. No events are dispatched,wl_proxy_destroyis not called when theproxy_tis destructed, user data is not touched. Consequently, there is no reference counting for theproxy_t. Lifetime of such wrappers should preferably be short to minimize the chance that the owning library decides to destroy thewl_proxy. π¨proxy_wrapperβ C pointer is awl_proxy*that was constructed withwl_proxy_create_wrapper. No events are dispatched,wl_proxy_wrapper_destroyis called when theproxy_tis destroyed. Reference counting is active. A reference to theproxy_tcreating this proxy wrapper is held to extend its lifetime until after the proxy wrapper is destroyed. π«Ά
Definition at line 117 of file wayland-client.hpp.
π₯ Member Function Documentation π₯
wl_proxy * wayland::proxy_t::c_ptr () const [inherited]
Get a pointer to the underlying C struct. π§·
Returns: The underlying wl_proxy wrapped by this proxy_t if it exists, otherwise an exception is thrown. π
bool pointer_t::can_release () const
Check whether the release function is available with the currently bound version of the protocol. π
Definition at line 2971 of file wayland-client-protocol.cpp.
std::string wayland::proxy_t::get_class () const [inherited]
Get the interface name (class) of a proxy object. π·οΈ
Returns: The interface name of the object associated with the proxy. π
uint32_t wayland::proxy_t::get_id () const [inherited]
Get the id of a proxy object. πͺͺ
Returns: The id the object associated with the proxy. π
uint32_t wayland::proxy_t::get_version () const [inherited]
Get the protocol object version of a proxy object. Gets the protocol object version of a proxy object, or 0 if the proxy was created with unversioned API. π’
A returned value of 0 means that no version information is available, so the caller must make safe assumptions about the objectβs real version. β οΈ
display_t will always return version 0. π₯οΈ
Returns: The protocol object version of the proxy or 0. β¨
wrapper_type wayland::proxy_t::get_wrapper_type () const [inline], [inherited]
Get the type of a proxy object. π§¬
Definition at line 303 of file wayland-client.hpp.
std::function< void(uint32_t, pointer_axis, double)> & pointer_t::on_axis ()
axis event. π
Parameters
timeβ timestamp with millisecond granularity. β±οΈaxisβ axis type. π§valueβ length of vector in surface-local coordinate space. π
Scroll and other axis notifications. π
For scroll events (vertical and horizontal scroll axes), the value parameter is the length of a vector along the specified axis in a coordinate space identical to those of motion events, representing a relative movement along the specified axis. πΌ
For devices that support movements non-parallel to axes multiple axis events will be emitted. π₯
When applicable, for example for touch pads, the server can choose to emit scroll events where the motion vector is equivalent to a motion event vector. ποΈ
When applicable, a client can transform its content relative to the scroll distance. πΈ
Definition at line 2997 of file wayland-client-protocol.cpp.
std::function< void(pointer_axis, int32_t)> & pointer_t::on_axis_discrete ()
axis click event. π±οΈ
Parameters
axisβ axis type. π§discreteβ number of steps. πͺ
Discrete step information for scroll and other axes. π
This event carries the axis value of the wl_pointer.axis event in discrete steps (e.g. mouse wheel clicks). π
This event is deprecated with wl_pointer version 8 - this event is not sent to clients supporting version 8 or later. π¨ deprecated warning, bestie, do not forget this one. π¨
This event does not occur on its own, it is coupled with a wl_pointer.axis event that represents this axis value on a continuous scale. The protocol guarantees that each axis_discrete event is always followed by exactly one axis event with the same axis number within the same wl_pointer.frame. Note that the protocol allows for other events to occur between the axis_discrete and its coupled axis event, including other axis_discrete or axis events. π§
This event is optional; continuous scrolling devices like two-finger scrolling on touchpads do not have discrete steps and do not generate this event. ποΈ
The discrete value carries the directional information. e.g. a value of -2 is two steps towards the negative direction of this axis. β¬
οΈ
The axis number is identical to the axis number in the associated axis event. π’
The order of wl_pointer.axis_discrete and wl_pointer.axis_source is not guaranteed. π
Definition at line 3017 of file wayland-client-protocol.cpp.
std::function< void(pointer_axis_source)> & pointer_t::on_axis_source ()
axis source event. π
Parameters
axis_sourceβ source of the axis event. π₯
Source information for scroll and other axes. π
This event does not occur on its own. It is sent before a wl_pointer.frame event and carries the source information for all events within that frame. π¬
The source specifies how this event was generated. If the source is wl_pointer.axis_source.finger, a wl_pointer.axis_stop event will be sent when the user lifts the finger off the device. ποΈ
If the source is wl_pointer.axis_source.wheel, wl_pointer.axis_source.wheel_tilt or wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event may or may not be sent. Whether a compositor sends an axis_stop event for these sources is hardware-specific and implementation-dependent; clients must not rely on receiving an axis_stop event for these scroll sources and should treat scroll sequences from these scroll sources as unterminated by default. β οΈ
This event is optional. If the source is unknown for a particular axis event sequence, no event is sent. Only one wl_pointer.axis_source event is permitted per frame. π
The order of wl_pointer.axis_discrete and wl_pointer.axis_source is not guaranteed. π
Definition at line 3007 of file wayland-client-protocol.cpp.
std::function< void(uint32_t, pointer_axis)> & pointer_t::on_axis_stop ()
axis stop event. π
Parameters
timeβ timestamp with millisecond granularity. β±οΈaxisβ the axis stopped with this event. π
Stop notification for scroll and other axes. π
For some wl_pointer.axis_source types, a wl_pointer.axis_stop event is sent to notify a client that the axis sequence has terminated. This enables the client to implement kinetic scrolling. See the wl_pointer.axis_source documentation for information on when this event may be generated. π
Any wl_pointer.axis events with the same axis_source after this event should be considered as the start of a new axis motion. β¨
The timestamp is to be interpreted identical to the timestamp in the wl_pointer.axis event. The timestamp value may be the same as a preceding wl_pointer.axis event. β±οΈ
Definition at line 3012 of file wayland-client-protocol.cpp. β and that closes out that last one, periodt π
on_axis_value120 β high-res scroll bestie π±οΈβ¨
std::function< void(pointer_axis, int32_t)> & pointer_t::on_axis_value120 ()
What it is: axis high-resolution scroll event.
Parameters:
- axis β axis type
- value120 β scroll distance as fraction of 120
Discrete high-resolution scroll information, no cap. Every multiple of 120 is one logical scroll step β one wheel detent. So an axis_value120 of 30 is one quarter of a logical scroll step in the positive direction, and a value120 of -240 is two logical scroll steps in the negative direction within the same hardware event. If youβre a client that relies on discrete scrolling, accumulate the value120 to multiples of 120 before processing the event.
The value120 must not be zero. Like, literally not allowed, bestie π«Ά
This event replaces the wl_pointer.axis_discrete event in clients supporting wl_pointer version 8 or later.
Where a wl_pointer.axis_source event occurs in the same wl_pointer.frame, the axis source applies to this event. The order of wl_pointer.axis_value120 and wl_pointer.axis_source is not guaranteed.
Definition at line 3022 of file wayland-client-protocol.cpp.
on_button β clicky-clacky notification π±οΈπ₯
std::function< void(uint32_t, uint32_t, uint32_t, pointer_button_state)> &
pointer_t::on_button ()
What it is: pointer button event.
Parameters:
- serial β serial number of the button event
- time β timestamp with millisecond granularity
- button β button that produced the event
- state β physical state of the button
Mouse button click and release notifications. The location of the click is given by the last motion or enter event. The time argument is a timestamp with millisecond granularity, with an undefined base.
The button is a button code as defined in the Linux kernelβs linux/input-event-codes.h header file, e.g. BTN_LEFT.
Any 16-bit button code value is reserved for future additions to the kernelβs event code list. All other button codes above 0xFFFF are currently undefined but may be used in future versions of this protocol.
Definition at line 2992 of file wayland-client-protocol.cpp.
on_enter β pointer has entered the chat πͺβ¨
std::function< void(uint32_t, surface_t, double, double)> &
pointer_t::on_enter ()
What it is: enter event.
Parameters:
- serial β serial number of the enter event
- surface β surface entered by the pointer
- surface_x β surface-local x coordinate
- surface_y β surface-local y coordinate
Notification that this seatβs pointer is focused on a certain surface. When a seatβs focus enters a surface, the pointer image is undefined and a client should respond to this event by setting an appropriate pointer image with the set_cursor request.
Definition at line 2977 of file wayland-client-protocol.cpp.
on_frame β end of the pointer event group π«
std::function< void()> & pointer_t::on_frame ()
What it is: end of a pointer event sequence. Indicates the end of a set of events that logically belong together. A client is expected to accumulate the data in all events within the frame before proceeding.
All wl_pointer events before a wl_pointer.frame event belong logically together. For example, in a diagonal scroll motion the compositor will send an optional wl_pointer.axis_source event, two wl_pointer.axis events (horizontal and vertical) and finally a wl_pointer.frame event. The client may use this information to calculate a diagonal vector for scrolling.
When multiple wl_pointer.axis events occur within the same frame, the motion vector is the combined motion of all events. When a wl_pointer.axis and a wl_pointer.axis_stop event occur within the same frame, this indicates that axis movement in one axis has stopped but continues in the other axis. When multiple wl_pointer.axis_stop events occur within the same frame, this indicates that these axes stopped in the same instance.
A wl_pointer.frame event is sent for every logical event group, even if the group only contains a single wl_pointer event. Specifically, a client may get a sequence: motion, frame, button, frame, axis, frame, axis_stop, frame.
The wl_pointer.enter and wl_pointer.leave events are logical events generated by the compositor and not the hardware. These events are also grouped by a wl_pointer.frame. When a pointer moves from one surface to another, a compositor should group the wl_pointer.leave event within the same wl_pointer.frame. However, a client must not rely on wl_pointer.leave and wl_pointer.enter being in the same wl_pointer.frame. Compositor-specific policies may require the wl_pointer.leave and wl_pointer.enter event being split across multiple wl_pointer.frame groups.
Definition at line 3002 of file wayland-client-protocol.cpp.
on_leave β bye-bye, surface ππ
std::function< void(uint32_t, surface_t)> & pointer_t::on_leave ()
What it is: leave event.
Parameters:
- serial β serial number of the leave event
- surface β surface left by the pointer
Notification that this seatβs pointer is no longer focused on a certain surface. The leave notification is sent before the enter notification for the new focus.
Definition at line 2982 of file wayland-client-protocol.cpp.
on_motion β pointer said βmove, bestieβ π¦
std::function< void(uint32_t, double, double)> & pointer_t::on_motion ()
What it is: pointer motion event.
Parameters:
- time β timestamp with millisecond granularity
- surface_x β surface-local x coordinate
- surface_y β surface-local y coordinate
Notification of pointer location change. The arguments surface_x and surface_y are the location relative to the focused surface.
Definition at line 2987 of file wayland-client-protocol.cpp.
proxy wrapper checks & operators π§ββοΈ
wayland::proxy_t::operator bool () const [inherited]
Check whether this wrapper actually wraps an object.
Returns: true if there is an underlying object, false if this wrapper is empty.
bool wayland::proxy_t::operator!= (const proxy_t & right) const [inherited]
Check whether two wrappers refer to different objects.
bool wayland::proxy_t::operator== (const proxy_t & right) const [inherited]
Check whether two wrappers refer to the same object.
bool wayland::proxy_t::proxy_has_object () const [inherited]
Check whether this wrapper actually wraps an object.
Returns: true if there is an underlying object, false if this wrapper is empty.
void wayland::proxy_t::proxy_release () [inherited]
Release the wrapped object (if any), making this an empty wrapper. Note that display_t instances cannot be released this way. Attempts to do so are ignored.
Examples: foreign_display.cpp.
pointer_t::release β tell the server youβre done π
void pointer_t::release ()
Release the pointer object. Using this request a client can tell the server that it is not going to use the pointer object anymore.
This request destroys the pointer proxy object, so clients must not call wl_pointer_destroy() after using this request.
Definition at line 2966 of file wayland-client-protocol.cpp.
pointer_t::set_cursor β cursor glow-up time π
void pointer_t::set_cursor (uint32_t serial, surface_t const & surface,
int32_t hotspot_x, int32_t hotspot_y)
Set the pointer surface β i.e. the surface that contains the pointer image (cursor).
Parameters:
- serial β serial number of the enter event
- surface β pointer surface
- hotspot_x β surface-local x coordinate
- hotspot_y β surface-local y coordinate
This request gives the surface the role of a cursor. If the surface already has another role, it raises a protocol error.
The cursor actually changes only if the pointer focus for this device is one of the requesting clientβs surfaces or the surface parameter is the current pointer surface. If there was a previous surface set with this request it is replaced. If surface is NULL, the pointer image is hidden.
The parameters hotspot_x and hotspot_y define the position of the pointer surface relative to the pointer location. Its top-left corner is always at (x, y) - (hotspot_x, hotspot_y), where (x, y) are the coordinates of the pointer location, in surface-local coordinates.
On surface.attach requests to the pointer surface, hotspot_x and hotspot_y are decremented by the x and y parameters passed to the request. Attach must be confirmed by wl_surface.commit as usual.
The hotspot can also be updated by passing the currently set pointer surface to this request with new values for hotspot_x and hotspot_y.
The current and pending input regions of the wl_surface are cleared, and wl_surface.set_input_region is ignored until the wl_surface is no longer used as the cursor. When the use as a cursor ends, the current and pending input regions become undefined, and the wl_surface is unmapped.
Theserialparameter must match the latestwl_pointer.enterserial number sent to the client. Otherwise the request will be ignored. No cap, those are the rules π
Definition at line 2960 of file wayland-client-protocol.cpp.
proxy_t::set_queue β give this proxy its own queue π§Ί
void wayland::proxy_t::set_queue (event_queue_t queue) [inherited]
Assign a proxy to an event queue.
Parameters:
- queue β The event queue that will handle this proxy
Assign proxy to event queue. Events coming from proxy will be queued in queue instead of the displayβs main queue.
See also: display_t::dispatch_queue().
Examples: proxy_wrapper.cpp.
β¨ Member Data Documentation β¨
release_since_version β minimum version for release π
std::uint32_t wayland::pointer_t::release_since_version = 3 [static], [constexpr]
Minimum protocol version required for the release function.
Definition at line 2783 of file wayland-client-protocol.hpp.
set_cursor_since_version β minimum version for set_cursor π
std::uint32_t wayland::pointer_t::set_cursor_since_version = 1 [static], [constexpr]
Minimum protocol version required for the set_cursor function.
Definition at line 2768 of file wayland-client-protocol.hpp.
Author π«Ά
Generated automatically by Doxygen for Wayland++ from the source code.
π And thatβs the whole wayland::pointer_t(3) page, bestie β auto-generated by Doxygen for Wayland++ from the source code, version 1.0.1, dated Fri Mar 27 2026 13:15:00. Slay and goodbye. π«Άβ¨
π¦ where this page comes from
- ubuntu stonking: waylandpp-dev 1.0.1-2 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms