pub struct AbsInfo(/* private fields */);Expand description
Information about an absolute axis (Abs).
Contains the axis’ current value, as well as range and resolution information.
Implementations§
Source§impl AbsInfo
impl AbsInfo
pub const fn new(minimum: i32, maximum: i32) -> Self
Sourcepub const fn raw_value(&self) -> i32
pub const fn raw_value(&self) -> i32
Returns the raw value of the axis, without clamping.
This is typically between AbsInfo::minimum and AbsInfo::maximum, but this is not
enforced by the kernel. AbsInfo::value clamps the value to the valid range.
pub const fn with_raw_value(self, value: i32) -> Self
pub const fn minimum(&self) -> i32
pub const fn with_minimum(self, minimum: i32) -> Self
pub const fn maximum(&self) -> i32
pub const fn with_maximum(self, maximum: i32) -> Self
pub const fn fuzz(&self) -> i32
pub const fn with_fuzz(self, fuzz: i32) -> Self
pub const fn flat(&self) -> i32
pub const fn with_flat(self, flat: i32) -> Self
Sourcepub const fn resolution(&self) -> i32
pub const fn resolution(&self) -> i32
Returns the resolution of this axis.
This is not the granularity of the value field (which is always 1), but the relation of the axis value to physical units.
The resolution for the main axes (Abs::X, Abs::Y, Abs::Z, and
Abs::MT_POSITION_X and Abs::MT_POSITION_Y) is typically specified in
units/mm.
If the device has set InputProp::ACCELEROMETER, the
units for the main X/Y/Z axes are in units/g instead.
Rotational axes (Abs::RX, Abs::RY, Abs::RZ) use units/radian.