{
int keys_old = menu_key_state;
int ret;
+ int is_down = 0, dev_id = 0;
- while (1)
- {
- int code, is_down = 0, dev_id = 0;
-
- code = in_update_keycode(&dev_id, &is_down, charcode, timeout_ms);
- if (code < 0)
- break;
+ in_update_keycode(&dev_id, &is_down, charcode, timeout_ms);
- if (keys_old != menu_key_state) {
- menu_last_used_dev = dev_id;
- break;
- }
- }
+ if (keys_old != menu_key_state)
+ menu_last_used_dev = dev_id;
ret = menu_key_state;
menu_key_state &= ~PBTN_CHAR;
}
}
- menu_key_state = 0;
-
/* flush events */
do {
ret = in_update_keycode(NULL, NULL, NULL, 0);
} while (ret >= 0);
+ menu_key_state = 0;
+
return 0;
}