diff options
Diffstat (limited to 'shell/input/sdl')
-rw-r--r-- | shell/input/sdl/input.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/shell/input/sdl/input.c b/shell/input/sdl/input.c index b26af1f..89034c0 100644 --- a/shell/input/sdl/input.c +++ b/shell/input/sdl/input.c @@ -53,7 +53,30 @@ uint32_t S9xReadJoypad(int32_t port) keystate = SDL_GetKeyState(NULL); - SDL_PollEvent(&event); + while (SDL_PollEvent(&event)) + { + switch (event.type) + { + case SDL_KEYDOWN: + switch(event.key.keysym.sym) + { + case SDLK_RCTRL: + case SDLK_END: + case SDLK_ESCAPE: + emulator_state = 1; + break; + } + break; + case SDLK_KEYUP: + switch(event.key.keysym.sym) + { + case SDLK_HOME: + emulator_state = 1; + break; + } + break; + } + } CASE(option.config_buttons[0][10], SNES_START_MASK); CASE(option.config_buttons[0][11], SNES_SELECT_MASK); @@ -68,7 +91,5 @@ uint32_t S9xReadJoypad(int32_t port) CASE(option.config_buttons[0][2], SNES_DOWN_MASK); CASE(option.config_buttons[0][3], SNES_LEFT_MASK); - if (keystate[option.config_buttons[0][12]]) emulator_state = 1; - return joypad; } |