pub unsafe extern "C" fn libinput_event_pointer_get_scroll_value(
    event: *mut libinput_event_pointer,
    axis: libinput_pointer_axis
) -> f64
Expand description

@ingroup event_pointer

Return the axis value of the given axis. The interpretation of the value depends on the axis. For the two scrolling axes @ref LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL and @ref LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, the value of the event is in relative scroll units, with the positive direction being down or right, respectively. If libinput_event_pointer_has_axis() returns 0 for an axis, this function returns 0 for that axis.

If the event is @ref LIBINPUT_EVENT_POINTER_SCROLL_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 event is @ref LIBINPUT_EVENT_POINTER_SCROLL_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 event is @ref LIBINPUT_EVENT_POINTER_SCROLL_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.

For pointer events that are not of type @ref LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, @ref LIBINPUT_EVENT_POINTER_SCROLL_FINGER, or @ref LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS, this function returns zero.

@note It is an application bug to call this function for events other than @ref LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, @ref LIBINPUT_EVENT_POINTER_SCROLL_FINGER, or @ref LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS.

@return The axis value of this event

@see libinput_event_pointer_get_scroll_value_v120

@since 1.19