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. Callers should use libinput_event_pointer_get_scroll_value_v120() for a simpler API of handling scroll wheel events of different step sizes.

If the source is @ref LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS, libinput guarantees that a scroll sequence is terminated with a scroll value of 0. The coordinate system is identical to the cursor movement, i.e. a scroll value of 1 represents the equivalent relative motion of 1.

@deprecated The source @ref LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT is deprecated as of libinput 1.16. No device has ever sent this source.

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.

@note This function is superfluous as of libinput 1.19. The event codes for @ref LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, @ref LIBINPUT_EVENT_POINTER_SCROLL_FINGER and @ref LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS have the axis source encoded in the event type.

@return The source for this axis event