commit d8667dca0b03383e6f3f91af4e5acaf281597a87
parent 69cfef46beafe0ee7cc5122ef01d88adea8e62f4
Author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
Date: Sat, 25 Dec 2021 22:58:10 +0100
emu event loop: peek for a key up only on key down event
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/uxnemu.c b/src/uxnemu.c
@@ -502,9 +502,11 @@ run(Uxn *u)
uxn_eval(u, devctrl->vector);
devctrl->dat[3] = 0;
- ksym = event.key.keysym.sym;
- if(SDL_PeepEvents(&event, 1, SDL_PEEKEVENT, SDL_KEYUP, SDL_KEYUP) == 1 && ksym == event.key.keysym.sym)
- goto breakout;
+ if(event.type == SDL_KEYDOWN) {
+ ksym = event.key.keysym.sym;
+ if(SDL_PeepEvents(&event, 1, SDL_PEEKEVENT, SDL_KEYUP, SDL_KEYUP) == 1 && ksym == event.key.keysym.sym)
+ goto breakout;
+ }
break;
case SDL_MOUSEWHEEL:
case SDL_MOUSEBUTTONUP: