[PATCH evtest 9/9] Always print EV_REP values, even when no properties exist

Peter Hutterer peter.hutterer at who-t.net
Wed Aug 21 20:46:54 PDT 2013


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 at who-t.net>
---
 evtest.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/evtest.c b/evtest.c
index 3b2f7bb..a92deff 100644
--- a/evtest.c
+++ b/evtest.c
@@ -758,7 +758,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]);
 	}
 
@@ -830,14 +830,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));
-- 
1.8.2.1



More information about the Input-tools mailing list