chiark / gitweb /
evdev-manip compiles and mostly works
authorian <ian>
Thu, 5 Jun 2008 23:07:42 +0000 (23:07 +0000)
committerian <ian>
Thu, 5 Jun 2008 23:07:42 +0000 (23:07 +0000)
hostside/evdev-manip.c

index 72ae4e5fa7036a8bd9f6fe1d69bbc69b7a97ec1f..86aab0720efd70066c09ef6345dd13b787afd5ea 100644 (file)
@@ -31,16 +31,16 @@ static Device *devices;
 static Mode mode;
 static int grab;
 
-static void pr_hexdec(unsigned long value) { printf("%#lx %ld",value,value); }
+static void pr_hex(unsigned long value) { printf("%#lx",value); }
 
 #define PR_TABLE_STR(tab, val) (pr_table_str(iesis_##tab, iesin_##tab, (val)))
 static void pr_table_str(const InputEventStringInfo *strings, int nstrings,
                         unsigned long value) {
   const InputEventStringInfo *string;
-  if (value > nstrings) { pr_hexdec(value); return; }
+  if (value > nstrings) { pr_hex(value); return; }
   string= &strings[value];
-  if (!string->prefix) { pr_hexdec(value); return; }
-  printf("%s %s", string->prefix, string->main);
+  if (!string->prefix) { pr_hex(value); return; }
+  printf("%s_%s", string->prefix, string->main);
 }
 
 static void pr_time(struct timeval tv) {
@@ -64,7 +64,7 @@ static void dump_event(Device *d, const struct input_event *ie) {
     if (!t->strings) t= 0;
   }
   if (t) pr_table_str(t->strings, t->nstrings, ie->code);
-  else pr_hexdec(ie->code);
+  else pr_hex(ie->code);
 
   printf(" ");
   switch (ie->type) {