pub struct PointerScrollWheelEvent { /* private fields */ }
Expand description
An event related to moving a scroll whell on a pointer device
Implementations§
Source§impl PointerScrollWheelEvent
impl PointerScrollWheelEvent
Sourcepub fn scroll_value_v120(&self, axis: Axis) -> f64
pub fn scroll_value_v120(&self, axis: Axis) -> f64
Return the axis value as a v120-normalized value, that represents the movement in logical mouse wheel clicks, normalized to the -120..+120 range.
A value that is a fraction of ±120 indicates a wheel movement less than one logical click, a caller should either scroll by the respective fraction of the normal scroll distance or accumulate that value until a multiple of 120 is reached.
For most callers, this is the preferred way of handling high-resolution scroll events.
The normalized v120 value does not take device-specific physical angles or distances into account,
i.e. a wheel with a click angle of 20 degrees produces only 18 logical clicks per 360 degree rotation,
a wheel with a click angle of 15 degrees produces 24 logical clicks per 360 degree rotation.
Where the physical angle matters, use PointerScrollEvent::scroll_value
instead.
The magic number 120 originates from the Windows Vista Mouse Wheel design document.