0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-24 06:45:11 +00:00

emu event loop: peek for a key up only on key down event

This commit is contained in:
Sigrid Solveig Haflínudóttir 2021-12-25 22:58:10 +01:00
parent 69cfef46be
commit d8667dca0b

View file

@ -502,9 +502,11 @@ run(Uxn *u)
uxn_eval(u, devctrl->vector); uxn_eval(u, devctrl->vector);
devctrl->dat[3] = 0; devctrl->dat[3] = 0;
if(event.type == SDL_KEYDOWN) {
ksym = event.key.keysym.sym; ksym = event.key.keysym.sym;
if(SDL_PeepEvents(&event, 1, SDL_PEEKEVENT, SDL_KEYUP, SDL_KEYUP) == 1 && ksym == event.key.keysym.sym) if(SDL_PeepEvents(&event, 1, SDL_PEEKEVENT, SDL_KEYUP, SDL_KEYUP) == 1 && ksym == event.key.keysym.sym)
goto breakout; goto breakout;
}
break; break;
case SDL_MOUSEWHEEL: case SDL_MOUSEWHEEL:
case SDL_MOUSEBUTTONUP: case SDL_MOUSEBUTTONUP: