aboutsummaryrefslogtreecommitdiffstats
path: root/toolbox
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-06-30 14:35:46 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-06-30 14:35:46 -0700
commitfb9134e3d01da0681097d5bf037aae730f09a2c0 (patch)
treeb16bd4a5f560b07705751f7e875f4a77608237a4 /toolbox
parent2e81f58baa246adbe4dcb479ef40c3f1ffcf8534 (diff)
parentf6d0f8af1768b3b9b10760bba5583c5e721b64ea (diff)
downloadsystem_core-fb9134e3d01da0681097d5bf037aae730f09a2c0.zip
system_core-fb9134e3d01da0681097d5bf037aae730f09a2c0.tar.gz
system_core-fb9134e3d01da0681097d5bf037aae730f09a2c0.tar.bz2
Merge "getevent: Fix a couple of bugs."
Diffstat (limited to 'toolbox')
-rw-r--r--toolbox/getevent.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/toolbox/getevent.c b/toolbox/getevent.c
index f0a6c24..c0ac94a 100644
--- a/toolbox/getevent.c
+++ b/toolbox/getevent.c
@@ -82,7 +82,7 @@ static int print_possible_events(int fd, int print_flags)
const char *bit_label;
printf(" events:\n");
- for(i = 0; i <= EV_MAX; i++) {
+ for(i = EV_KEY; i <= EV_MAX; i++) { // skip EV_SYN since we cannot query its available codes
int count = 0;
while(1) {
res = ioctl(fd, EVIOCGBIT(i, bits_size), bits);
@@ -97,10 +97,6 @@ static int print_possible_events(int fd, int print_flags)
}
res2 = 0;
switch(i) {
- case EV_SYN:
- label = "SYN";
- bit_labels = syn_labels;
- break;
case EV_KEY:
res2 = ioctl(fd, EVIOCGKEY(res), bits + bits_size);
label = "KEY";
@@ -252,7 +248,7 @@ static void print_event(int type, int code, int value, int print_flags)
if (value_label)
printf(" %-20.20s", value_label);
else
- printf(" %08x ", code);
+ printf(" %08x ", value);
} else {
printf("%04x %04x %08x", type, code, value);
}