mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-06 23:28:04 -04:00
fix menu input handling (timeout non-working)
This commit is contained in:
parent
271f900173
commit
1eb399bd4c
1 changed files with 6 additions and 14 deletions
20
input.c
20
input.c
|
@ -432,20 +432,12 @@ int in_menu_wait_any(char *charcode, int timeout_ms)
|
||||||
{
|
{
|
||||||
int keys_old = menu_key_state;
|
int keys_old = menu_key_state;
|
||||||
int ret;
|
int ret;
|
||||||
|
int is_down = 0, dev_id = 0;
|
||||||
|
|
||||||
while (1)
|
in_update_keycode(&dev_id, &is_down, charcode, timeout_ms);
|
||||||
{
|
|
||||||
int code, is_down = 0, dev_id = 0;
|
|
||||||
|
|
||||||
code = in_update_keycode(&dev_id, &is_down, charcode, timeout_ms);
|
if (keys_old != menu_key_state)
|
||||||
if (code < 0)
|
menu_last_used_dev = dev_id;
|
||||||
break;
|
|
||||||
|
|
||||||
if (keys_old != menu_key_state) {
|
|
||||||
menu_last_used_dev = dev_id;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = menu_key_state;
|
ret = menu_key_state;
|
||||||
menu_key_state &= ~PBTN_CHAR;
|
menu_key_state &= ~PBTN_CHAR;
|
||||||
|
@ -548,13 +540,13 @@ static int in_set_blocking(int is_blocking)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_key_state = 0;
|
|
||||||
|
|
||||||
/* flush events */
|
/* flush events */
|
||||||
do {
|
do {
|
||||||
ret = in_update_keycode(NULL, NULL, NULL, 0);
|
ret = in_update_keycode(NULL, NULL, NULL, 0);
|
||||||
} while (ret >= 0);
|
} while (ret >= 0);
|
||||||
|
|
||||||
|
menu_key_state = 0;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue