diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-08-22 10:17:02 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-08-23 09:20:24 +1000 |
commit | 3ba2bc8a02bd9a517a59e9ea1518c7be7f34fbf6 (patch) | |
tree | 50c1d306272ac42852295b38b3fa7a0d5fc4c2a9 | |
parent | 1a630708464d28f1095944b261fa06856a721e28 (diff) | |
download | external_evtest-3ba2bc8a02bd9a517a59e9ea1518c7be7f34fbf6.tar.gz external_evtest-3ba2bc8a02bd9a517a59e9ea1518c7be7f34fbf6.tar.bz2 external_evtest-3ba2bc8a02bd9a517a59e9ea1518c7be7f34fbf6.zip |
Always print EV_REP values, even when no properties exist
Previous code had repeat handling within the ifdef INPUT_PROP_SEMI_MT.
EV_REP pre-dates input properties.
Also rename the actual printing code. Repeat handling is sort-of a property
but let's not confuse the two.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
-rw-r--r-- | evtest.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -760,7 +760,7 @@ static void print_repdata(int fd) ioctl(fd, EVIOCGREP, rep); for (i = 0; i <= REP_MAX; i++) { - printf(" Property code %d (%s)\n", i, names[EV_REP] ? (names[EV_REP][i] ? names[EV_REP][i] : "?") : "?"); + printf(" Repeat code %d (%s)\n", i, names[EV_REP] ? (names[EV_REP][i] ? names[EV_REP][i] : "?") : "?"); printf(" Value %6d\n", rep[i]); } @@ -832,14 +832,15 @@ static int print_device_info(int fd) } } + if (test_bit(EV_REP, bit[0])) { + printf("Key repeat handling:\n"); + printf(" Repeat type %d (%s)\n", EV_REP, events[EV_REP] ? events[EV_REP] : "?"); + print_repdata(fd); + } #ifdef INPUT_PROP_SEMI_MT memset(propbits, 0, sizeof(propbits)); ioctl(fd, EVIOCGPROP(sizeof(propbits)), propbits); printf("Properties:\n"); - if (test_bit(EV_REP, bit[0])) { - printf(" Property type %d (%s)\n", EV_REP, events[EV_REP] ? events[EV_REP] : "?"); - print_repdata(fd); - } for (prop = 0; prop < INPUT_PROP_MAX; prop++) { if (test_bit(prop, propbits)) printf(" Property type %d (%s)\n", prop, propname(prop)); |