summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-01-14 14:12:28 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-01-15 10:07:05 +1000
commitd5a07eb00b4f6c4aa404164d6dbbd981bf917141 (patch)
tree4c1bb7fb656afa4c34f55ae2d55aa7a81b08f9fc /src
parent3c5483ac160572e6b5ede10561a790e5c21d717e (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/libinput.c12
-rw-r--r--src/libinput.h27
2 files changed, 30 insertions, 9 deletions
diff --git a/src/libinput.c b/src/libinput.c
index e9883ffd..84a723a3 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -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,
diff --git a/src/libinput.h b/src/libinput.h
index 7b9236de..3b90f0b0 100644
--- a/src/libinput.h
+++ b/src/libinput.h
@@ -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