Function input_sys::libinput_event_pointer_get_axis_source[][src]

pub unsafe extern "C" fn libinput_event_pointer_get_axis_source(
    event: *mut libinput_event_pointer
) -> libinput_pointer_axis_source
Expand description

@ingroup event_pointer

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 @ref LIBINPUT_POINTER_AXIS_SOURCE_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 @ref LIBINPUT_POINTER_AXIS_SOURCE_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 @ref LIBINPUT_POINTER_AXIS_SOURCE_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 @ref LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT, 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 @ref LIBINPUT_POINTER_AXIS_SOURCE_WHEEL above). Callers should not use this value but instead exclusively refer to the value returned by libinput_event_pointer_get_axis_value_discrete().

For pointer events that are not of type @ref LIBINPUT_EVENT_POINTER_AXIS, this function returns 0.

@note It is an application bug to call this function for events other than @ref LIBINPUT_EVENT_POINTER_AXIS.

@return The source for this axis event