uxn

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

commit 22c6e07fca0955214f2ce94a9817a02473a8c3db
parent 84f17059f73c2690fe5d95736bd5328ac853ec6f
Author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
Date:   Wed, 29 Dec 2021 23:31:08 +0100

emu: make sure to handle key down event if the same key is up at the same frame

Diffstat:
Msrc/uxnemu.c | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -466,6 +466,11 @@ run(Uxn *u) controller_down(devctrl, get_button(&event)); else do_shortcut(u, &event); + if(event.type == SDL_KEYDOWN) { + int ksym = event.key.keysym.sym; + if(SDL_PeepEvents(&event, 1, SDL_PEEKEVENT, SDL_KEYUP, SDL_KEYUP) == 1 && ksym == event.key.keysym.sym) + break; + } } else if(event.type == SDL_KEYUP) controller_up(devctrl, get_button(&event)); else if(event.type == SDL_JOYAXISMOTION) {