diff options
Diffstat (limited to 'v4l2-apps/util/keytable.c')
-rw-r--r-- | v4l2-apps/util/keytable.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/v4l2-apps/util/keytable.c b/v4l2-apps/util/keytable.c index 4b39a43f0..4283782d0 100644 --- a/v4l2-apps/util/keytable.c +++ b/v4l2-apps/util/keytable.c @@ -107,7 +107,7 @@ int main (int argc, char *argv[]) for (j = 0; j < 256; j++) { for (i = 0; i < 256; i++) { codes[0] = (j << 8) | i; - codes[1] = KEY_UNKNOWN; + codes[1] = KEY_RESERVED; ioctl(fd, EVIOCSKEYCODE, codes); } } @@ -146,8 +146,10 @@ int main (int argc, char *argv[]) codes [1] = (unsigned) value; // printf("\t%04x=%04x\n",codes[0], codes[1]); - if(ioctl(fd, EVIOCSKEYCODE, codes)) + if(ioctl(fd, EVIOCSKEYCODE, codes)) { + fprintf(stderr, "Setting scancode 0x%04x with 0x%04x via ",codes[0], codes[1]); perror ("EVIOCSKEYCODE"); + } if(ioctl(fd, EVIOCGKEYCODE, codes)==0) prtcode(codes); @@ -159,7 +161,7 @@ int main (int argc, char *argv[]) for (j = 0; j < 256; j++) { for (i = 0; i < 256; i++) { codes[0] = (j << 8) | i; - if(ioctl(fd, EVIOCGKEYCODE, codes)==0) + if (!ioctl(fd, EVIOCGKEYCODE, codes) && codes[1] != KEY_RESERVED) prtcode(codes); } } |