pub struct WlPointer { /* private fields */ }Expand description
A wl_pointer object.
See the documentation of the module for the interface description.
Implementations§
Source§impl WlPointer
impl WlPointer
Sourcepub fn set_handler(&self, handler: impl WlPointerHandler)
pub fn set_handler(&self, handler: impl WlPointerHandler)
Sets a new handler.
Sourcepub fn set_boxed_handler(&self, handler: Box<dyn WlPointerHandler>)
pub fn set_boxed_handler(&self, handler: Box<dyn WlPointerHandler>)
Sets a new, already boxed handler.
Source§impl WlPointer
impl WlPointer
Sourcepub const MSG__SET_CURSOR__SINCE: u32 = 1u32
pub const MSG__SET_CURSOR__SINCE: u32 = 1u32
Since when the set_cursor message is available.
Sourcepub const MSG__ENTER__SINCE: u32 = 1u32
pub const MSG__ENTER__SINCE: u32 = 1u32
Since when the enter message is available.
Sourcepub const MSG__LEAVE__SINCE: u32 = 1u32
pub const MSG__LEAVE__SINCE: u32 = 1u32
Since when the leave message is available.
Sourcepub const MSG__MOTION__SINCE: u32 = 1u32
pub const MSG__MOTION__SINCE: u32 = 1u32
Since when the motion message is available.
Sourcepub const MSG__BUTTON__SINCE: u32 = 1u32
pub const MSG__BUTTON__SINCE: u32 = 1u32
Since when the button message is available.
Sourcepub const MSG__AXIS__SINCE: u32 = 1u32
pub const MSG__AXIS__SINCE: u32 = 1u32
Since when the axis message is available.
Sourcepub const MSG__RELEASE__SINCE: u32 = 3u32
pub const MSG__RELEASE__SINCE: u32 = 3u32
Since when the release message is available.
Sourcepub const MSG__FRAME__SINCE: u32 = 5u32
pub const MSG__FRAME__SINCE: u32 = 5u32
Since when the frame message is available.
Sourcepub const MSG__AXIS_SOURCE__SINCE: u32 = 5u32
pub const MSG__AXIS_SOURCE__SINCE: u32 = 5u32
Since when the axis_source message is available.
Sourcepub const MSG__AXIS_STOP__SINCE: u32 = 5u32
pub const MSG__AXIS_STOP__SINCE: u32 = 5u32
Since when the axis_stop message is available.
Sourcepub const MSG__AXIS_DISCRETE__SINCE: u32 = 5u32
pub const MSG__AXIS_DISCRETE__SINCE: u32 = 5u32
Since when the axis_discrete message is available.
Sourcepub const MSG__AXIS_DISCRETE__DEPRECATED_SINCE: u32 = 8u32
pub const MSG__AXIS_DISCRETE__DEPRECATED_SINCE: u32 = 8u32
Since when the axis_discrete message is deprecated.
Sourcepub const MSG__AXIS_VALUE120__SINCE: u32 = 8u32
pub const MSG__AXIS_VALUE120__SINCE: u32 = 8u32
Since when the axis_value120 message is available.
Sourcepub const MSG__AXIS_RELATIVE_DIRECTION__SINCE: u32 = 9u32
pub const MSG__AXIS_RELATIVE_DIRECTION__SINCE: u32 = 9u32
Since when the axis_relative_direction message is available.
Sourcepub fn try_send_set_cursor(
&self,
serial: u32,
surface: Option<&Rc<WlSurface>>,
hotspot_x: i32,
hotspot_y: i32,
) -> Result<(), ObjectError>
pub fn try_send_set_cursor( &self, serial: u32, surface: Option<&Rc<WlSurface>>, hotspot_x: i32, hotspot_y: i32, ) -> Result<(), ObjectError>
set the pointer surface
Set the pointer surface, i.e., the surface that contains the pointer image (cursor). 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 wl_surface.offset requests to the pointer surface, hotspot_x and hotspot_y are decremented by the x and y parameters passed to the request. The offset must be applied 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 input region is ignored for wl_surfaces with the role of a cursor. When the use as a cursor ends, the wl_surface is unmapped.
The serial parameter must match the latest wl_pointer.enter serial number sent to the client. Otherwise the request will be ignored.
§Arguments
serial: serial number of the enter eventsurface: pointer surfacehotspot_x: surface-local x coordinatehotspot_y: surface-local y coordinate
Sourcepub fn send_set_cursor(
&self,
serial: u32,
surface: Option<&Rc<WlSurface>>,
hotspot_x: i32,
hotspot_y: i32,
)
pub fn send_set_cursor( &self, serial: u32, surface: Option<&Rc<WlSurface>>, hotspot_x: i32, hotspot_y: i32, )
set the pointer surface
Set the pointer surface, i.e., the surface that contains the pointer image (cursor). 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 wl_surface.offset requests to the pointer surface, hotspot_x and hotspot_y are decremented by the x and y parameters passed to the request. The offset must be applied 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 input region is ignored for wl_surfaces with the role of a cursor. When the use as a cursor ends, the wl_surface is unmapped.
The serial parameter must match the latest wl_pointer.enter serial number sent to the client. Otherwise the request will be ignored.
§Arguments
serial: serial number of the enter eventsurface: pointer surfacehotspot_x: surface-local x coordinatehotspot_y: surface-local y coordinate
Sourcepub fn try_send_enter(
&self,
serial: u32,
surface: &Rc<WlSurface>,
surface_x: Fixed,
surface_y: Fixed,
) -> Result<(), ObjectError>
pub fn try_send_enter( &self, serial: u32, surface: &Rc<WlSurface>, surface_x: Fixed, surface_y: Fixed, ) -> Result<(), ObjectError>
enter event
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.
§Arguments
serial: serial number of the enter eventsurface: surface entered by the pointersurface_x: surface-local x coordinatesurface_y: surface-local y coordinate
Sourcepub fn send_enter(
&self,
serial: u32,
surface: &Rc<WlSurface>,
surface_x: Fixed,
surface_y: Fixed,
)
pub fn send_enter( &self, serial: u32, surface: &Rc<WlSurface>, surface_x: Fixed, surface_y: Fixed, )
enter event
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.
§Arguments
serial: serial number of the enter eventsurface: surface entered by the pointersurface_x: surface-local x coordinatesurface_y: surface-local y coordinate
Sourcepub fn try_send_leave(
&self,
serial: u32,
surface: &Rc<WlSurface>,
) -> Result<(), ObjectError>
pub fn try_send_leave( &self, serial: u32, surface: &Rc<WlSurface>, ) -> Result<(), ObjectError>
leave event
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.
§Arguments
serial: serial number of the leave eventsurface: surface left by the pointer
Sourcepub fn send_leave(&self, serial: u32, surface: &Rc<WlSurface>)
pub fn send_leave(&self, serial: u32, surface: &Rc<WlSurface>)
leave event
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.
§Arguments
serial: serial number of the leave eventsurface: surface left by the pointer
Sourcepub fn try_send_motion(
&self,
time: u32,
surface_x: Fixed,
surface_y: Fixed,
) -> Result<(), ObjectError>
pub fn try_send_motion( &self, time: u32, surface_x: Fixed, surface_y: Fixed, ) -> Result<(), ObjectError>
pointer motion event
Notification of pointer location change. The arguments surface_x and surface_y are the location relative to the focused surface.
§Arguments
time: timestamp with millisecond granularitysurface_x: surface-local x coordinatesurface_y: surface-local y coordinate
Sourcepub fn send_motion(&self, time: u32, surface_x: Fixed, surface_y: Fixed)
pub fn send_motion(&self, time: u32, surface_x: Fixed, surface_y: Fixed)
pointer motion event
Notification of pointer location change. The arguments surface_x and surface_y are the location relative to the focused surface.
§Arguments
time: timestamp with millisecond granularitysurface_x: surface-local x coordinatesurface_y: surface-local y coordinate
pointer button event
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.
§Arguments
serial: serial number of the button eventtime: timestamp with millisecond granularitybutton: button that produced the eventstate: physical state of the button
pointer button event
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.
§Arguments
serial: serial number of the button eventtime: timestamp with millisecond granularitybutton: button that produced the eventstate: physical state of the button
Sourcepub fn try_send_axis(
&self,
time: u32,
axis: WlPointerAxis,
value: Fixed,
) -> Result<(), ObjectError>
pub fn try_send_axis( &self, time: u32, axis: WlPointerAxis, value: Fixed, ) -> Result<(), ObjectError>
axis event
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.
§Arguments
time: timestamp with millisecond granularityaxis: axis typevalue: length of vector in surface-local coordinate space
Sourcepub fn send_axis(&self, time: u32, axis: WlPointerAxis, value: Fixed)
pub fn send_axis(&self, time: u32, axis: WlPointerAxis, value: Fixed)
axis event
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.
§Arguments
time: timestamp with millisecond granularityaxis: axis typevalue: length of vector in surface-local coordinate space
Sourcepub fn try_send_release(&self) -> Result<(), ObjectError>
pub fn try_send_release(&self) -> Result<(), ObjectError>
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.
Sourcepub fn send_release(&self)
pub fn send_release(&self)
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.
Sourcepub fn try_send_frame(&self) -> Result<(), ObjectError>
pub fn try_send_frame(&self) -> Result<(), ObjectError>
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.
Sourcepub fn send_frame(&self)
pub fn send_frame(&self)
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.
Sourcepub fn try_send_axis_source(
&self,
axis_source: WlPointerAxisSource,
) -> Result<(), ObjectError>
pub fn try_send_axis_source( &self, axis_source: WlPointerAxisSource, ) -> Result<(), ObjectError>
axis source 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.
§Arguments
axis_source: source of the axis event
Sourcepub fn send_axis_source(&self, axis_source: WlPointerAxisSource)
pub fn send_axis_source(&self, axis_source: WlPointerAxisSource)
axis source 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.
§Arguments
axis_source: source of the axis event
Sourcepub fn try_send_axis_stop(
&self,
time: u32,
axis: WlPointerAxis,
) -> Result<(), ObjectError>
pub fn try_send_axis_stop( &self, time: u32, axis: WlPointerAxis, ) -> Result<(), ObjectError>
axis stop 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.
§Arguments
time: timestamp with millisecond granularityaxis: the axis stopped with this event
Sourcepub fn send_axis_stop(&self, time: u32, axis: WlPointerAxis)
pub fn send_axis_stop(&self, time: u32, axis: WlPointerAxis)
axis stop 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.
§Arguments
time: timestamp with millisecond granularityaxis: the axis stopped with this event
Sourcepub fn try_send_axis_discrete(
&self,
axis: WlPointerAxis,
discrete: i32,
) -> Result<(), ObjectError>
pub fn try_send_axis_discrete( &self, axis: WlPointerAxis, discrete: i32, ) -> Result<(), ObjectError>
axis click event
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.
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. A wl_pointer.frame must not contain more than one axis_discrete event per axis type.
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.
§Arguments
axis: axis typediscrete: number of steps
Sourcepub fn send_axis_discrete(&self, axis: WlPointerAxis, discrete: i32)
pub fn send_axis_discrete(&self, axis: WlPointerAxis, discrete: i32)
axis click event
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.
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. A wl_pointer.frame must not contain more than one axis_discrete event per axis type.
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.
§Arguments
axis: axis typediscrete: number of steps
Sourcepub fn try_send_axis_value120(
&self,
axis: WlPointerAxis,
value120: i32,
) -> Result<(), ObjectError>
pub fn try_send_axis_value120( &self, axis: WlPointerAxis, value120: i32, ) -> Result<(), ObjectError>
axis high-resolution scroll event
Discrete high-resolution scroll information.
This event carries high-resolution wheel scroll information, with each multiple of 120 representing one logical scroll step (a wheel detent). For example, an axis_value120 of 30 is one quarter of a logical scroll step in the positive direction, a value120 of -240 are two logical scroll steps in the negative direction within the same hardware event. Clients that rely on discrete scrolling should accumulate the value120 to multiples of 120 before processing the event.
The value120 must not be zero.
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.
§Arguments
axis: axis typevalue120: scroll distance as fraction of 120
Sourcepub fn send_axis_value120(&self, axis: WlPointerAxis, value120: i32)
pub fn send_axis_value120(&self, axis: WlPointerAxis, value120: i32)
axis high-resolution scroll event
Discrete high-resolution scroll information.
This event carries high-resolution wheel scroll information, with each multiple of 120 representing one logical scroll step (a wheel detent). For example, an axis_value120 of 30 is one quarter of a logical scroll step in the positive direction, a value120 of -240 are two logical scroll steps in the negative direction within the same hardware event. Clients that rely on discrete scrolling should accumulate the value120 to multiples of 120 before processing the event.
The value120 must not be zero.
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.
§Arguments
axis: axis typevalue120: scroll distance as fraction of 120
Sourcepub fn try_send_axis_relative_direction(
&self,
axis: WlPointerAxis,
direction: WlPointerAxisRelativeDirection,
) -> Result<(), ObjectError>
pub fn try_send_axis_relative_direction( &self, axis: WlPointerAxis, direction: WlPointerAxisRelativeDirection, ) -> Result<(), ObjectError>
axis relative physical direction event
Relative directional information of the entity causing the axis motion.
For a wl_pointer.axis event, the wl_pointer.axis_relative_direction event specifies the movement direction of the entity causing the wl_pointer.axis event. For example:
- if a user’s fingers on a touchpad move down and this causes a wl_pointer.axis vertical_scroll down event, the physical direction is ‘identical’
- if a user’s fingers on a touchpad move down and this causes a wl_pointer.axis vertical_scroll up scroll up event (‘natural scrolling’), the physical direction is ‘inverted’.
A client may use this information to adjust scroll motion of components. Specifically, enabling natural scrolling causes the content to change direction compared to traditional scrolling. Some widgets like volume control sliders should usually match the physical direction regardless of whether natural scrolling is active. This event enables clients to match the scroll direction of a widget to the physical direction.
This event does not occur on its own, it is coupled with a wl_pointer.axis event that represents this axis value. The protocol guarantees that each axis_relative_direction 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_relative_direction and its coupled axis event.
The axis number is identical to the axis number in the associated axis event.
The order of wl_pointer.axis_relative_direction, wl_pointer.axis_discrete and wl_pointer.axis_source is not guaranteed.
§Arguments
axis: axis typedirection: physical direction relative to axis motion
Sourcepub fn send_axis_relative_direction(
&self,
axis: WlPointerAxis,
direction: WlPointerAxisRelativeDirection,
)
pub fn send_axis_relative_direction( &self, axis: WlPointerAxis, direction: WlPointerAxisRelativeDirection, )
axis relative physical direction event
Relative directional information of the entity causing the axis motion.
For a wl_pointer.axis event, the wl_pointer.axis_relative_direction event specifies the movement direction of the entity causing the wl_pointer.axis event. For example:
- if a user’s fingers on a touchpad move down and this causes a wl_pointer.axis vertical_scroll down event, the physical direction is ‘identical’
- if a user’s fingers on a touchpad move down and this causes a wl_pointer.axis vertical_scroll up scroll up event (‘natural scrolling’), the physical direction is ‘inverted’.
A client may use this information to adjust scroll motion of components. Specifically, enabling natural scrolling causes the content to change direction compared to traditional scrolling. Some widgets like volume control sliders should usually match the physical direction regardless of whether natural scrolling is active. This event enables clients to match the scroll direction of a widget to the physical direction.
This event does not occur on its own, it is coupled with a wl_pointer.axis event that represents this axis value. The protocol guarantees that each axis_relative_direction 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_relative_direction and its coupled axis event.
The axis number is identical to the axis number in the associated axis event.
The order of wl_pointer.axis_relative_direction, wl_pointer.axis_discrete and wl_pointer.axis_source is not guaranteed.
§Arguments
axis: axis typedirection: physical direction relative to axis motion
Source§impl WlPointer
impl WlPointer
Sourcepub const ENM__ERROR_ROLE__SINCE: u32 = 1u32
pub const ENM__ERROR_ROLE__SINCE: u32 = 1u32
Since when the error.role enum variant is available.
Sourcepub const ENM__BUTTON_STATE_RELEASED__SINCE: u32 = 1u32
pub const ENM__BUTTON_STATE_RELEASED__SINCE: u32 = 1u32
Since when the button_state.released enum variant is available.
Sourcepub const ENM__BUTTON_STATE_PRESSED__SINCE: u32 = 1u32
pub const ENM__BUTTON_STATE_PRESSED__SINCE: u32 = 1u32
Since when the button_state.pressed enum variant is available.
Sourcepub const ENM__AXIS_VERTICAL_SCROLL__SINCE: u32 = 1u32
pub const ENM__AXIS_VERTICAL_SCROLL__SINCE: u32 = 1u32
Since when the axis.vertical_scroll enum variant is available.
Sourcepub const ENM__AXIS_HORIZONTAL_SCROLL__SINCE: u32 = 1u32
pub const ENM__AXIS_HORIZONTAL_SCROLL__SINCE: u32 = 1u32
Since when the axis.horizontal_scroll enum variant is available.
Sourcepub const ENM__AXIS_SOURCE_WHEEL__SINCE: u32 = 1u32
pub const ENM__AXIS_SOURCE_WHEEL__SINCE: u32 = 1u32
Since when the axis_source.wheel enum variant is available.
Sourcepub const ENM__AXIS_SOURCE_FINGER__SINCE: u32 = 1u32
pub const ENM__AXIS_SOURCE_FINGER__SINCE: u32 = 1u32
Since when the axis_source.finger enum variant is available.
Sourcepub const ENM__AXIS_SOURCE_CONTINUOUS__SINCE: u32 = 1u32
pub const ENM__AXIS_SOURCE_CONTINUOUS__SINCE: u32 = 1u32
Since when the axis_source.continuous enum variant is available.
Sourcepub const ENM__AXIS_SOURCE_WHEEL_TILT__SINCE: u32 = 6u32
pub const ENM__AXIS_SOURCE_WHEEL_TILT__SINCE: u32 = 6u32
Since when the axis_source.wheel_tilt enum variant is available.
Sourcepub const ENM__AXIS_RELATIVE_DIRECTION_IDENTICAL__SINCE: u32 = 1u32
pub const ENM__AXIS_RELATIVE_DIRECTION_IDENTICAL__SINCE: u32 = 1u32
Since when the axis_relative_direction.identical enum variant is available.
Sourcepub const ENM__AXIS_RELATIVE_DIRECTION_INVERTED__SINCE: u32 = 1u32
pub const ENM__AXIS_RELATIVE_DIRECTION_INVERTED__SINCE: u32 = 1u32
Since when the axis_relative_direction.inverted enum variant is available.
Trait Implementations§
Source§impl ConcreteObject for WlPointer
impl ConcreteObject for WlPointer
Source§const XML_VERSION: u32 = 10u32
const XML_VERSION: u32 = 10u32
Source§const INTERFACE: ObjectInterface = ObjectInterface::WlPointer
const INTERFACE: ObjectInterface = ObjectInterface::WlPointer
Source§const INTERFACE_NAME: &str = "wl_pointer"
const INTERFACE_NAME: &str = "wl_pointer"
Source§impl Object for WlPointer
impl Object for WlPointer
Source§fn core(&self) -> &ObjectCore
fn core(&self) -> &ObjectCore
ObjectCore of this object.Source§fn unset_handler(&self)
fn unset_handler(&self)
Source§fn get_handler_any_ref(
&self,
) -> Result<HandlerRef<'_, dyn Any>, HandlerAccessError>
fn get_handler_any_ref( &self, ) -> Result<HandlerRef<'_, dyn Any>, HandlerAccessError>
Source§fn get_handler_any_mut(
&self,
) -> Result<HandlerMut<'_, dyn Any>, HandlerAccessError>
fn get_handler_any_mut( &self, ) -> Result<HandlerMut<'_, dyn Any>, HandlerAccessError>
Auto Trait Implementations§
impl !Freeze for WlPointer
impl !RefUnwindSafe for WlPointer
impl !Send for WlPointer
impl !Sync for WlPointer
impl Unpin for WlPointer
impl !UnwindSafe for WlPointer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ObjectCoreApi for T
impl<T> ObjectCoreApi for T
Source§fn client(&self) -> Option<Rc<Client>>
fn client(&self) -> Option<Rc<Client>>
Client associated with this object, if any.Source§fn interface(&self) -> ObjectInterface
fn interface(&self) -> ObjectInterface
ObjectInterface of this object.