projects
/
platform
/
upstream
/
libevdev.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e1d87fa
)
tools: complain about devices that don't have abs x/y axes in the edge detector
author
Peter Hutterer
<peter.hutterer@who-t.net>
Tue, 13 Jan 2015 00:45:22 +0000
(10:45 +1000)
committer
Peter Hutterer
<peter.hutterer@who-t.net>
Wed, 10 Jun 2015 04:53:40 +0000
(14:53 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tools/touchpad-edge-detector.c
patch
|
blob
|
history
diff --git
a/tools/touchpad-edge-detector.c
b/tools/touchpad-edge-detector.c
index e5420cf69149af3407ca781050ce4900d1fdaed3..fdc496e5f6656d994d06e06b822124213a174c59 100644
(file)
--- 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);