From c6d560b0adc5b321115f2597091422787588b807 Mon Sep 17 00:00:00 2001 From: gameblabla Date: Fri, 16 Oct 2020 05:25:14 +0200 Subject: Revert some of the Miyoo specific changes and make it so the menu button code works on most OpenDingux like platform. --- shell/input/sdl/input.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'shell/input/sdl/input.c') 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; } -- cgit v1.2.3