uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit fac4acb717a65437515fa1d6ea16d098818b7511
parent 1538b1bf7255b975dbd87e813d0cca491810fbba
Author: Devine Lu Linvega <aliceffekt@gmail.com>
Date:   Mon, 18 Nov 2024 16:48:19 -0800

Console EOF patch

Diffstat:
Msrc/uxnemu.c | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -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; }