int keycode;
if ((keycode = evdev_get_keycode(fd, scancode, 1)) < 0) {
- if (keycode != -2)
- r = -1;
+ if (keycode == -2)
+ continue;
+ r = -1;
break;
}
/* grab input device */
ioctl(fd, EVIOCGRAB, 1);
- puts("Press ESC to finish");
+ puts("Press ESC to finish, or Control-C if this device is not your primary keyboard");
has_scan = has_key = 0;
while (read_event(fd, &ev)) {