pub struct PointerAxisEvent { /* private fields */ }
PointerEvent::Scroll*
events insteadExpand description
An event related to moving axis on a pointer device
Implementations§
Source§impl PointerAxisEvent
impl PointerAxisEvent
Sourcepub fn has_axis(&self, axis: Axis) -> bool
👎Deprecated: Use PointerScrollEvent::has_axis
instead
pub fn has_axis(&self, axis: Axis) -> bool
PointerScrollEvent::has_axis
insteadCheck if the event has a valid value for the given axis.
If this function returns true for an axis and axis_value
returns a
value of 0, the event is a scroll stop event.
Sourcepub fn axis_source(&self) -> AxisSource
👎Deprecated: Use PointerScroll*
events instead
pub fn axis_source(&self) -> AxisSource
PointerScroll*
events insteadReturn the source for a given axis event.
Axis events (scroll events) can be caused by a hardware item such as a scroll wheel or emulated from other input sources, such as two-finger or edge scrolling on a touchpad.
If the source is Finger
, libinput guarantees that a scroll sequence is
terminated with a scroll value of 0. A caller may use this information to
decide on whether kinetic scrolling should be triggered on this scroll
sequence. The coordinate system is identical to the cursor movement, i.e.
a scroll value of 1 represents the equivalent relative motion of 1.
If the source is Wheel
, no terminating event is guaranteed (though it
may happen). Scrolling is in discrete steps, the value is the angle the
wheel moved in degrees. The default is 15 degrees per wheel click, but
some mice may have differently grained wheels. It is up to the caller how
to interpret such different step sizes.
If the source is Continuous
, no terminating event is guaranteed (though
it may happen). The coordinate system is identical to the cursor movement,
i.e. a scroll value of 1 represents the equivalent relative motion of 1.
If the source is WheelTilt
, no terminating event is guaranteed (though
it may happen). Scrolling is in discrete steps and there is no physical
equivalent for the value returned here. For backwards compatibility, the
value returned by this function is identical to a single mouse wheel
rotation by this device (see the documentation for WheelTilt
above).
Callers should not use this value but instead exclusively refer to the
Sourcepub fn axis_value(&self, axis: Axis) -> f64
👎Deprecated: Use PointerScrollEvent::scroll_value
instead
pub fn axis_value(&self, axis: Axis) -> f64
PointerScrollEvent::scroll_value
insteadReturn the axis value of the given axis.
The interpretation of the value depends on the axis. For the two scrolling
axes Vertical
and Horizontal
, the value of the event is in relative
scroll units, with the positive direction being down or right,
respectively. For the interpretation of the value, see axis_source
.
If has_axis
returns false
for an axis, this function returns 0 for
that axis.
Sourcepub fn axis_value_discrete(&self, axis: Axis) -> Option<f64>
👎Deprecated: Use PointerScrollWheelEvent::scroll_value_v120
instead
pub fn axis_value_discrete(&self, axis: Axis) -> Option<f64>
PointerScrollWheelEvent::scroll_value_v120
insteadReturn the axis value in discrete steps for a given axis event.
How a value translates into a discrete step depends on the source.
If the source is Wheel
, the discrete value correspond to the number of
physical mouse wheel clicks.
If the source is Continuous
or Finger
, the discrete value is always
None
.