summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2015-01-13 10:45:22 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2015-06-10 14:53:40 +1000
commitf54656ecc145caa69bd54c5cade332bf000e4668 (patch)
treec47d12071169fe729df99118a5b5ee37f29b8862 /tools
parente1d87fa6dfa9cdd3ade490911db49e48871a1295 (diff)
downloadlibevdev-f54656ecc145caa69bd54c5cade332bf000e4668.tar.gz
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/touchpad-edge-detector.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/touchpad-edge-detector.c b/tools/touchpad-edge-detector.c
index e5420cf..fdc496e 100644
--- a/tools/touchpad-edge-detector.c
+++ b/tools/touchpad-edge-detector.c
@@ -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);