mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-31 14:40:08 +01:00
tablet: allow the various get_<axis> on tablet button events
There's no reason to prevent this for button events. Unlike the pointer which is a relative device a tablet is (usually) a device with a lot of state. Caller code that handles axes is likely shared between the various events, treating button events separately here doesn't get us any benefit. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
This commit is contained in:
parent
3c5483ac16
commit
d5a07eb00b
2 changed files with 30 additions and 9 deletions
|
|
@ -921,6 +921,7 @@ libinput_event_tablet_tool_x_has_changed(
|
|||
0,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_AXIS,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_TIP,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_BUTTON,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
|
||||
|
||||
return bit_is_set(event->changed_axes,
|
||||
|
|
@ -936,6 +937,7 @@ libinput_event_tablet_tool_y_has_changed(
|
|||
0,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_AXIS,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_TIP,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_BUTTON,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
|
||||
|
||||
return bit_is_set(event->changed_axes,
|
||||
|
|
@ -951,6 +953,7 @@ libinput_event_tablet_tool_pressure_has_changed(
|
|||
0,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_AXIS,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_TIP,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_BUTTON,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
|
||||
|
||||
return bit_is_set(event->changed_axes,
|
||||
|
|
@ -966,6 +969,7 @@ libinput_event_tablet_tool_distance_has_changed(
|
|||
0,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_AXIS,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_TIP,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_BUTTON,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
|
||||
|
||||
return bit_is_set(event->changed_axes,
|
||||
|
|
@ -981,6 +985,7 @@ libinput_event_tablet_tool_tilt_x_has_changed(
|
|||
0,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_AXIS,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_TIP,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_BUTTON,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
|
||||
|
||||
return bit_is_set(event->changed_axes,
|
||||
|
|
@ -996,6 +1001,7 @@ libinput_event_tablet_tool_tilt_y_has_changed(
|
|||
0,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_AXIS,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_TIP,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_BUTTON,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
|
||||
|
||||
return bit_is_set(event->changed_axes,
|
||||
|
|
@ -1011,6 +1017,7 @@ libinput_event_tablet_tool_rotation_has_changed(
|
|||
0,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_AXIS,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_TIP,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_BUTTON,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
|
||||
|
||||
return bit_is_set(event->changed_axes,
|
||||
|
|
@ -1026,6 +1033,7 @@ libinput_event_tablet_tool_slider_has_changed(
|
|||
0,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_AXIS,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_TIP,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_BUTTON,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
|
||||
|
||||
return bit_is_set(event->changed_axes,
|
||||
|
|
@ -1041,6 +1049,7 @@ libinput_event_tablet_tool_wheel_has_changed(
|
|||
0,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_AXIS,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_TIP,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_BUTTON,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
|
||||
|
||||
return bit_is_set(event->changed_axes,
|
||||
|
|
@ -1059,6 +1068,7 @@ libinput_event_tablet_tool_get_axis_value(struct libinput_event_tablet_tool *eve
|
|||
0,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_AXIS,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_TIP,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_BUTTON,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
|
||||
|
||||
switch(axis) {
|
||||
|
|
@ -1177,6 +1187,7 @@ libinput_event_tablet_tool_get_x_transformed(struct libinput_event_tablet_tool *
|
|||
0,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_AXIS,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_TIP,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_BUTTON,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
|
||||
|
||||
return evdev_device_transform_x(device,
|
||||
|
|
@ -1196,6 +1207,7 @@ libinput_event_tablet_tool_get_y_transformed(struct libinput_event_tablet_tool *
|
|||
0,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_AXIS,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_TIP,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_BUTTON,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
|
||||
|
||||
return evdev_device_transform_y(device,
|
||||
|
|
|
|||
|
|
@ -1375,7 +1375,8 @@ libinput_event_tablet_tool_get_base_event(struct libinput_event_tablet_tool *eve
|
|||
* @note It is an application bug to call this function for events other
|
||||
* than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY.
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
|
||||
*
|
||||
* @param event The libinput tablet event
|
||||
* @return 1 if the axis was updated or 0 otherwise
|
||||
|
|
@ -1395,7 +1396,8 @@ libinput_event_tablet_tool_x_has_changed(
|
|||
* @note It is an application bug to call this function for events other
|
||||
* than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY.
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
|
||||
*
|
||||
* @param event The libinput tablet event
|
||||
* @return 1 if the axis was updated or 0 otherwise
|
||||
|
|
@ -1415,7 +1417,8 @@ libinput_event_tablet_tool_y_has_changed(
|
|||
* @note It is an application bug to call this function for events other
|
||||
* than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY.
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
|
||||
*
|
||||
* @param event The libinput tablet event
|
||||
* @return 1 if the axis was updated or 0 otherwise
|
||||
|
|
@ -1437,7 +1440,8 @@ libinput_event_tablet_tool_pressure_has_changed(
|
|||
* @note It is an application bug to call this function for events other
|
||||
* than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY.
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
|
||||
*
|
||||
* @param event The libinput tablet event
|
||||
* @return 1 if the axis was updated or 0 otherwise
|
||||
|
|
@ -1457,7 +1461,8 @@ libinput_event_tablet_tool_distance_has_changed(
|
|||
* @note It is an application bug to call this function for events other
|
||||
* than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY.
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
|
||||
*
|
||||
* @param event The libinput tablet event
|
||||
* @return 1 if the axis was updated or 0 otherwise
|
||||
|
|
@ -1477,7 +1482,8 @@ libinput_event_tablet_tool_tilt_x_has_changed(
|
|||
* @note It is an application bug to call this function for events other
|
||||
* than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY.
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
|
||||
*
|
||||
* @param event The libinput tablet event
|
||||
* @return 1 if the axis was updated or 0 otherwise
|
||||
|
|
@ -1496,7 +1502,8 @@ libinput_event_tablet_tool_tilt_y_has_changed(
|
|||
* @note It is an application bug to call this function for events other
|
||||
* than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY.
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
|
||||
*
|
||||
* @param event The libinput tablet event
|
||||
* @return 1 if the axis was updated or 0 otherwise
|
||||
|
|
@ -1515,7 +1522,8 @@ libinput_event_tablet_tool_rotation_has_changed(
|
|||
* @note It is an application bug to call this function for events other
|
||||
* than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY.
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
|
||||
*
|
||||
* @param event The libinput tablet event
|
||||
* @return 1 if the axis was updated or 0 otherwise
|
||||
|
|
@ -1534,7 +1542,8 @@ libinput_event_tablet_tool_slider_has_changed(
|
|||
* @note It is an application bug to call this function for events other
|
||||
* than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY.
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref
|
||||
* LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
|
||||
*
|
||||
* @param event The libinput tablet event
|
||||
* @return 1 if the axis was updated or 0 otherwise
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue