SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit fcbbecea1795430c31a309fa92dc2a0ae69f4924 parent 2afeb7dee388c0605efad12c96b5c019e7ed6e8a Author: Lior Halphon <LIJI32@gmail.com> Date: Tue, 18 May 2021 20:21:21 +0300 Fix #386 Diffstat:
| M | SDL/gui.c | 34 | +++++++++++++++++----------------- |
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/SDL/gui.c b/SDL/gui.c @@ -1375,7 +1375,22 @@ void run_gui(bool is_running) case SDL_KEYDOWN: - if (event_hotkey_code(&event) == SDL_SCANCODE_F && event.key.keysym.mod & MODIFIER) { + if (gui_state == WAITING_FOR_KEY) { + if (current_selection >= 8) { + if (current_selection == 8) { + configuration.keys[8] = event.key.keysym.scancode; + } + else { + configuration.keys_2[current_selection - 9] = event.key.keysym.scancode; + } + } + else { + configuration.keys[current_selection] = event.key.keysym.scancode; + } + gui_state = SHOWING_MENU; + should_render = true; + } + else if (event_hotkey_code(&event) == SDL_SCANCODE_F && event.key.keysym.mod & MODIFIER) { if ((SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN_DESKTOP) == false) { SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); } @@ -1384,7 +1399,7 @@ void run_gui(bool is_running) } update_viewport(); } - if (event_hotkey_code(&event) == SDL_SCANCODE_O) { + else if (event_hotkey_code(&event) == SDL_SCANCODE_O) { if (event.key.keysym.mod & MODIFIER) { char *filename = do_open_rom_dialog(); if (filename) { @@ -1477,21 +1492,6 @@ void run_gui(bool is_running) } should_render = true; } - else if (gui_state == WAITING_FOR_KEY) { - if (current_selection >= 8) { - if (current_selection == 8) { - configuration.keys[8] = event.key.keysym.scancode; - } - else { - configuration.keys_2[current_selection - 9] = event.key.keysym.scancode; - } - } - else { - configuration.keys[current_selection] = event.key.keysym.scancode; - } - gui_state = SHOWING_MENU; - should_render = true; - } break; }
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.