aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2015-11-20 13:17:56 +0100
committerGerd Hoffmann <kraxel@redhat.com>2015-11-20 13:17:56 +0100
commit81be8b5dc9245546bf1af297d6e6a580143c5273 (patch)
tree8cb43e9f2cde70978331102537d99394a998e482
parentc491c68b9efa9346b8aaf4bd7505b36b5b584ff3 (diff)
downloadinput-81be8b5dc9245546bf1af297d6e6a580143c5273.tar.gz
report absinfo
-rw-r--r--input.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/input.c b/input.c
index 42ed322..26258f8 100644
--- a/input.c
+++ b/input.c
@@ -103,6 +103,7 @@ int device_open(int nr, int verbose)
int device_info(int nr, int fd, int verbose)
{
struct input_id id;
+ struct input_absinfo abs;
char name[64];
char phys[64];
char buf[64];
@@ -165,9 +166,29 @@ int device_info(int nr, int fd, int verbose)
pos ? " " : "",
EV_TYPE_NAME[evt][bit]);
}
- if (pos >= sizeof(buf)) {
+ if (pos >= sizeof(buf) ||
+ ((verbose > 1) && (evt == EV_ABS))) {
fprintf(stderr, " %-4.4s : [ %d codes ]\n",
EV_NAME[evt], count);
+ if (verbose > 1) {
+ for (bit = 0, count = 0, pos = 0;
+ bit < bits*8 && bit < EV_TYPE_MAX[evt];
+ bit++) {
+ if (!test_bit(bit,bitmap))
+ continue;
+ if (evt == EV_ABS) {
+ ioctl(fd, EVIOCGABS(bit), &abs);
+ fprintf(stderr, " "
+ "%-16s [ %5d, %5d ]\n",
+ EV_TYPE_NAME[evt][bit],
+ abs.minimum,
+ abs.maximum);
+ } else {
+ fprintf(stderr, " %s\n",
+ EV_TYPE_NAME[evt][bit]);
+ }
+ }
+ }
} else {
fprintf(stderr, " %-4.4s : %s\n",
EV_NAME[evt], buf);