Skip to content

Commit

Permalink
SDL2: Two small fixes in the key handling.
Browse files Browse the repository at this point in the history
- Workaround for using the keypad enter key in gui console mode.
- Fixed fullscreen toggle handling in the SDL_KEYUP case.
  • Loading branch information
vruppert committed Dec 25, 2024
1 parent 43eeb55 commit eb1978f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bochs/gui/sdl2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,9 @@ void bx_sdl2_gui_c::handle_events(void)
}
// handle gui console mode
if (console_running()) {
if (sdl_event.key.keysym.sym == SDLK_KP_ENTER) {
sdl_event.key.keysym.sym = SDLK_RETURN;
}
if ((sdl_event.key.keysym.sym & (1 << 30)) == 0) {
Bit8u ascii = (Bit8u)sdl_event.key.keysym.sym;
if ((ascii == SDLK_RETURN) || (ascii == SDLK_BACKSPACE)) {
Expand Down Expand Up @@ -890,7 +893,8 @@ void bx_sdl2_gui_c::handle_events(void)
}

// filter out release of Windows/Fullscreen toggle
if (sdl_event.key.keysym.sym != SDLK_SCROLLLOCK) {
if ((sdl_event.key.keysym.sym != SDLK_RETURN) ||
(bx_gui->get_modifier_keys() != BX_MOD_KEY_ALT)) {
// convert sym->bochs code
if (!SIM->get_param_bool(BXPN_KBD_USEMAPPING)->get()) {
key_event = sdl_sym_to_bx_key(sdl_event.key.keysym.sym);
Expand Down

0 comments on commit eb1978f

Please sign in to comment.