0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-22 13:55:11 +00:00

Console EOF patch

This commit is contained in:
Devine Lu Linvega 2024-11-18 16:48:19 -08:00
parent 1538b1bf72
commit fac4acb717

View file

@ -132,10 +132,16 @@ stdin_handler(void *p)
SDL_Event event; SDL_Event event;
USED(p); USED(p);
event.type = stdin_event; event.type = stdin_event;
event.cbutton.state = CONSOLE_STD;
while(read(0, &event.cbutton.button, 1) > 0) { while(read(0, &event.cbutton.button, 1) > 0) {
while(SDL_PushEvent(&event) < 0) while(SDL_PushEvent(&event) < 0)
SDL_Delay(25); /* slow down - the queue is most likely full */ 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; return 0;
} }
@ -391,7 +397,7 @@ handle_events(void)
} }
/* Console */ /* Console */
else if(event.type == stdin_event) else if(event.type == stdin_event)
console_input(event.cbutton.button, CONSOLE_STD); console_input(event.cbutton.button, event.cbutton.state);
} }
return 1; return 1;
} }