diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2015-12-14 10:23:56 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-12-21 07:59:00 +1000 |
commit | f96ee412df5e00e7ed9bf8d630c84fddacae6f4d (patch) | |
tree | 3474f7fd58e7eae73848a6f510c95418ed1f1d9b /src/libinput.h | |
parent | 828ca69c770d51fa4832bb9819ccaf1dbf440c0c (diff) |
tablet: reduce event deltas to only apply to the wheel
Part of the big revamp to get rid of libinput_tablet_tool_axis and
replace it with a set of axis-specific APIs.
Only the rel wheel has true delta events, everything else is a delta
calculated by libinput based on the previous position. Since we supply that
position to the callers anyway, they can determine that delta themselves
where needed.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Lyude <cpaul@redhat.com>
Diffstat (limited to 'src/libinput.h')
-rw-r--r-- | src/libinput.h | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/src/libinput.h b/src/libinput.h index 01e23cb3..36911c81 100644 --- a/src/libinput.h +++ b/src/libinput.h @@ -1640,39 +1640,30 @@ libinput_event_tablet_tool_get_slider_position(struct libinput_event_tablet_tool /** * @ingroup event_tablet * - * Return the delta for a given axis for a tablet. The interpretation of the - * value is axis-dependent: - * - @ref LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL - A relative wheel on the tool, - * similar or equivalent to a mouse wheel. The value is a delta from the - * device's previous position, in degrees. - * For all other axes, see libinput_event_tablet_tool_get_axis_value() for - * details. + * Return the delta for the wheel in degrees. * * @param event The libinput tablet event - * @param axis The axis to retrieve the value of - * @return The delta to the previous axis value + * @return The delta of the wheel, in degrees, compared to the last event + * + * @see libinput_event_tablet_tool_get_wheel_delta_discrete */ double -libinput_event_tablet_tool_get_axis_delta(struct libinput_event_tablet_tool *event, - enum libinput_tablet_tool_axis axis); +libinput_event_tablet_tool_get_wheel_delta( + struct libinput_event_tablet_tool *event); /** * @ingroup event_tablet * - * Return the delta for a given axis for a tablet in discrete steps. - * How a value translates into a discrete step depends on the axis: - * - @ref LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL - the returned value is the number - * of physical mouse wheel clicks. - * For all other axes, this function returns 0. - * + * Return the delta for the wheel in discrete steps (e.g. wheel clicks). + * @param event The libinput tablet event - * @param axis The axis to retrieve the value of - * @return The delta to the previous axis value in discrete steps + * @return The delta of the wheel, in discrete steps, compared to the last event + * + * @see libinput_event_tablet_tool_get_wheel_delta_discrete */ -double -libinput_event_tablet_tool_get_axis_delta_discrete( - struct libinput_event_tablet_tool *event, - enum libinput_tablet_tool_axis axis); +int +libinput_event_tablet_tool_get_wheel_delta_discrete( + struct libinput_event_tablet_tool *event); /** * @ingroup event_tablet |