mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-11-05 05:45:05 +00:00
uxnemu: delay for 25ms if failed to push stdin event - queue is probably full
This commit is contained in:
parent
1bba517f37
commit
5f4cb9ba05
1 changed files with 4 additions and 2 deletions
6
src/uxnemu.c
Normal file → Executable file
6
src/uxnemu.c
Normal file → Executable file
|
@ -131,8 +131,10 @@ stdin_handler(void *p)
|
|||
SDL_Event event;
|
||||
USED(p);
|
||||
event.type = stdin_event;
|
||||
while(read(0, &event.cbutton.button, 1) > 0 && SDL_PushEvent(&event) >= 0)
|
||||
;
|
||||
while(read(0, &event.cbutton.button, 1) > 0){
|
||||
while(SDL_PushEvent(&event) < 0)
|
||||
SDL_Delay(25); /* slow down - the queue is most likely full */
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue