diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2015-11-20 13:17:56 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-11-20 13:17:56 +0100 |
commit | 81be8b5dc9245546bf1af297d6e6a580143c5273 (patch) | |
tree | 8cb43e9f2cde70978331102537d99394a998e482 /input.c | |
parent | c491c68b9efa9346b8aaf4bd7505b36b5b584ff3 (diff) | |
download | input-81be8b5dc9245546bf1af297d6e6a580143c5273.tar.gz |
report absinfo
Diffstat (limited to 'input.c')
-rw-r--r-- | input.c | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -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); |