mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-24 10:00:08 +01:00
tools: complain about devices that don't have abs x/y axes in the edge detector
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
e1d87fa6df
commit
f54656ecc1
1 changed files with 8 additions and 0 deletions
|
|
@ -169,6 +169,13 @@ int main (int argc, char **argv) {
|
|||
}
|
||||
libevdev_grab(dev, LIBEVDEV_UNGRAB);
|
||||
|
||||
if (!libevdev_has_event_code(dev, EV_ABS, ABS_X) ||
|
||||
!libevdev_has_event_code(dev, EV_ABS, ABS_Y)) {
|
||||
fprintf(stderr, "Error: this device does not have abs axes\n");
|
||||
rc = EXIT_FAILURE;
|
||||
goto out;
|
||||
}
|
||||
|
||||
dim.left = INT_MAX;
|
||||
dim.right = INT_MIN;
|
||||
dim.top = INT_MAX;
|
||||
|
|
@ -188,6 +195,7 @@ int main (int argc, char **argv) {
|
|||
|
||||
printf("\n");
|
||||
|
||||
out:
|
||||
libevdev_free(dev);
|
||||
close(fd);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue