mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-11-21 21:35:11 +00:00
Console EOF patch
This commit is contained in:
parent
1538b1bf72
commit
fac4acb717
1 changed files with 7 additions and 1 deletions
|
@ -132,10 +132,16 @@ stdin_handler(void *p)
|
|||
SDL_Event event;
|
||||
USED(p);
|
||||
event.type = stdin_event;
|
||||
event.cbutton.state = CONSOLE_STD;
|
||||
while(read(0, &event.cbutton.button, 1) > 0) {
|
||||
while(SDL_PushEvent(&event) < 0)
|
||||
SDL_Delay(25); /* slow down - the queue is most likely full */
|
||||
}
|
||||
/* EOF */
|
||||
event.cbutton.button = 0x00;
|
||||
event.cbutton.state = CONSOLE_END;
|
||||
while(SDL_PushEvent(&event) < 0)
|
||||
SDL_Delay(25);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -391,7 +397,7 @@ handle_events(void)
|
|||
}
|
||||
/* Console */
|
||||
else if(event.type == stdin_event)
|
||||
console_input(event.cbutton.button, CONSOLE_STD);
|
||||
console_input(event.cbutton.button, event.cbutton.state);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue