mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-11-28 00:33:02 +00:00
emu event loop: peek for a key up only on key down event
This commit is contained in:
parent
69cfef46be
commit
d8667dca0b
1 changed files with 5 additions and 3 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue