aboutsummaryrefslogtreecommitdiff
path: root/shell/input/sdl
diff options
context:
space:
mode:
authorgameblabla2020-10-16 05:25:14 +0200
committergameblabla2020-10-16 05:25:14 +0200
commitc6d560b0adc5b321115f2597091422787588b807 (patch)
treef039e18bc7fca2c6cd2a999522620678c5b9ff07 /shell/input/sdl
parent9ea18f315c385ec85cb28d44659b45589cfc9ac0 (diff)
downloadsnesemu-c6d560b0adc5b321115f2597091422787588b807.tar.gz
snesemu-c6d560b0adc5b321115f2597091422787588b807.tar.bz2
snesemu-c6d560b0adc5b321115f2597091422787588b807.zip
Revert some of the Miyoo specific changes
and make it so the menu button code works on most OpenDingux like platform.
Diffstat (limited to 'shell/input/sdl')
-rw-r--r--shell/input/sdl/input.c27
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;
}