mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-24 12:20:38 +01:00
tablet: always return 0 for axis values on non-axis events
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
1219b399de
commit
b1869eae76
1 changed files with 9 additions and 0 deletions
|
|
@ -504,6 +504,9 @@ LIBINPUT_EXPORT double
|
|||
libinput_event_tablet_get_axis_value(struct libinput_event_tablet *event,
|
||||
enum libinput_tablet_axis axis)
|
||||
{
|
||||
if (event->base.type != LIBINPUT_EVENT_TABLET_AXIS)
|
||||
return 0;
|
||||
|
||||
return (axis >= 0 && axis < LIBINPUT_TABLET_AXIS_CNT) ?
|
||||
event->axes[axis] : 0;
|
||||
}
|
||||
|
|
@ -515,6 +518,9 @@ libinput_event_tablet_get_x_transformed(struct libinput_event_tablet *event,
|
|||
struct evdev_device *device =
|
||||
(struct evdev_device *) event->base.device;
|
||||
|
||||
if (event->base.type != LIBINPUT_EVENT_TABLET_AXIS)
|
||||
return 0;
|
||||
|
||||
return evdev_device_transform_x(device,
|
||||
event->axes[LIBINPUT_TABLET_AXIS_X],
|
||||
width);
|
||||
|
|
@ -527,6 +533,9 @@ libinput_event_tablet_get_y_transformed(struct libinput_event_tablet *event,
|
|||
struct evdev_device *device =
|
||||
(struct evdev_device *) event->base.device;
|
||||
|
||||
if (event->base.type != LIBINPUT_EVENT_TABLET_AXIS)
|
||||
return 0;
|
||||
|
||||
return evdev_device_transform_y(device,
|
||||
event->axes[LIBINPUT_TABLET_AXIS_Y],
|
||||
height);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue