mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-11-27 16:23:02 +00:00
emu: make sure to handle key down event if the same key is up at the same frame
This commit is contained in:
parent
84f17059f7
commit
22c6e07fca
1 changed files with 5 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue