diff options
| author | Peter Hutterer <peter.hutterer@who-t.net> | 2015-01-13 10:45:22 +1000 |
|---|---|---|
| committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-06-10 14:53:40 +1000 |
| commit | f54656ecc145caa69bd54c5cade332bf000e4668 (patch) | |
| tree | c47d12071169fe729df99118a5b5ee37f29b8862 | |
| parent | e1d87fa6dfa9cdd3ade490911db49e48871a1295 (diff) | |
| download | libevdev-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>
| -rw-r--r-- | tools/touchpad-edge-detector.c | 8 |
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); |
