mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2025-04-19 01:16:56 +02:00
getkey: gracefully take command after other keyboard primitives
This commit is contained in:
parent
d655aa934f
commit
b6f545e63c
1 changed files with 9 additions and 0 deletions
|
@ -33,6 +33,15 @@ key_event_t getkey_opt(int opt, volatile int *timeout)
|
||||||
/* Keyboard time when the key was pressed */
|
/* Keyboard time when the key was pressed */
|
||||||
static int rep_time = 0;
|
static int rep_time = 0;
|
||||||
|
|
||||||
|
/* Reset the state if the repeated key went up due to different
|
||||||
|
graphical primitives being used */
|
||||||
|
if(rep_key && !keydown(rep_key))
|
||||||
|
{
|
||||||
|
rep_key = 0;
|
||||||
|
rep_count = 0;
|
||||||
|
rep_time = 0;
|
||||||
|
}
|
||||||
|
|
||||||
while(1) switch((ev = pollevent()).type)
|
while(1) switch((ev = pollevent()).type)
|
||||||
{
|
{
|
||||||
/* Key press: handle modifiers or return an event */
|
/* Key press: handle modifiers or return an event */
|
||||||
|
|
Loading…
Add table
Reference in a new issue