mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-11-24 06:45:11 +00:00
Clear up SDL_KEYDOWN/SDL_TEXTINPUT logic
This commit is contained in:
parent
4789d8ccef
commit
205f63cc43
1 changed files with 8 additions and 9 deletions
17
src/uxnemu.c
17
src/uxnemu.c
|
@ -465,20 +465,19 @@ run(Uxn *u)
|
|||
else if(event.type == SDL_MOUSEWHEEL)
|
||||
mouse_scroll(devmouse, event.wheel.x, event.wheel.y);
|
||||
/* Controller */
|
||||
else if(event.type == SDL_KEYDOWN || event.type == SDL_TEXTINPUT) {
|
||||
if(event.type == SDL_TEXTINPUT)
|
||||
controller_key(devctrl, event.text.text[0]);
|
||||
else if(get_key(&event))
|
||||
else if(event.type == SDL_TEXTINPUT)
|
||||
controller_key(devctrl, event.text.text[0]);
|
||||
else if(event.type == SDL_KEYDOWN) {
|
||||
int ksym;
|
||||
if(get_key(&event))
|
||||
controller_key(devctrl, get_key(&event));
|
||||
else if(get_button(&event))
|
||||
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;
|
||||
}
|
||||
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