diff --git a/port/fast3d/gfx_sdl2.cpp b/port/fast3d/gfx_sdl2.cpp index 25ce3c3d..d6369669 100644 --- a/port/fast3d/gfx_sdl2.cpp +++ b/port/fast3d/gfx_sdl2.cpp @@ -299,9 +299,9 @@ static void gfx_sdl_handle_events(void) { if (event.key.keysym.sym == SDLK_RETURN && (event.key.keysym.mod & KMOD_ALT)) { // alt-enter received, switch fullscreen state set_fullscreen(!fullscreen_state, true); - } else if (event.key.keysym.sym == SDLK_ESCAPE) { - // GE's own menus use the keyboard; ESC on an empty event - // queue is our quit key (matches the Phase 1 demo loop). + } else if (event.key.keysym.sym == SDLK_F4 && (event.key.keysym.mod & KMOD_ALT)) { + // D145: Alt+F4 quits; bare ESC no longer does (it is the + // menu "back" key -- see port/src/video.c / input.c). exit(0); } break; diff --git a/port/src/input.c b/port/src/input.c index 9b617221..00a81cca 100644 --- a/port/src/input.c +++ b/port/src/input.c @@ -435,7 +435,7 @@ unsigned inputComputePad(int idx, signed char *stick_x, signed char *stick_y) wheelPulse--; } if (keyDown(ks, SDL_SCANCODE_X) || keyDown(ks, SDL_SCANCODE_R) || - keyDown(ks, SDL_SCANCODE_F)) + keyDown(ks, SDL_SCANCODE_F) || keyDown(ks, SDL_SCANCODE_ESCAPE)) /* D145: ESC = B (back/cancel) */ button |= GE_CONT_B; if (keyDown(ks, SDL_SCANCODE_Q)) button |= GE_CONT_L; diff --git a/port/src/video.c b/port/src/video.c index 7143e1a0..d08ffb57 100644 --- a/port/src/video.c +++ b/port/src/video.c @@ -197,8 +197,14 @@ void videoPumpEvents(void) exit(0); break; case SDL_KEYDOWN: - if (ev.key.keysym.sym == SDLK_ESCAPE) { - sysLogPrintf(LOG_INFO, "video: ESC -> quit"); + /* D145: bare ESC used to exit(0). On the front-end / debrief + * screens ESC is the natural "back" key, so a player pressing it + * to page back instead quit the whole game (looked like a crash -- + * clean exit, no crash log). ESC now feeds the N64 B button + * (back / cancel) via input.c; quitting is window-close (the X) or + * Alt+F4 only. */ + if ((ev.key.keysym.sym == SDLK_F4) && (ev.key.keysym.mod & KMOD_ALT)) { + sysLogPrintf(LOG_INFO, "video: Alt+F4 -> quit"); exit(0); } else if (ev.key.keysym.sym == SDLK_F12 && !ev.key.repeat) { screenshotReq = 1;