Struct input::event::pointer::PointerAxisEvent
[−]
[src]
pub struct PointerAxisEvent { /* fields omitted */ }An event related to moving axis on a pointer device
Methods
impl PointerAxisEvent[src]
fn has_axis(&self, axis: Axis) -> bool
Check if the event has a valid value for the given axis.
If this function returns non-zero for an axis and axis_value returns a
value of 0, the event is a scroll stop event.
fn axis_source(&self) -> AxisSource
Return 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
fn axis_value(&self, axis: Axis) -> f64
Return 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.
fn axis_value_discrete(&self, axis: Axis) -> Option<f64>
Return 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.
Trait Implementations
impl Eq for PointerAxisEvent[src]
impl Debug for PointerAxisEvent[src]
impl FromRaw<libinput_event_pointer> for PointerAxisEvent[src]
unsafe fn from_raw(ffi: *mut libinput_event_pointer) -> Self
Create a new instance of this type from a raw pointer. Read more
impl AsRaw<libinput_event_pointer> for PointerAxisEvent[src]
fn as_raw(&self) -> *const libinput_event_pointer
Receive a raw pointer representing this type.
impl PartialEq for PointerAxisEvent[src]
fn eq(&self, other: &Self) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0
This method tests for !=.
impl Hash for PointerAxisEvent[src]
fn hash<H: Hasher>(&self, state: &mut H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher1.3.0
Feeds a slice of this type into the state provided.
impl EventTrait for PointerAxisEvent[src]
fn into_event(self) -> Event where Self: Sized
Convert into a general Event again
fn context(&self) -> Libinput
Get the libinput context from the event.
fn device(&self) -> Device
Return the device associated with this event. Read more