diff --git a/src/m_menu.c b/src/m_menu.c index 922841404..0ff11513c 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -147,6 +147,8 @@ boolean browselocalskins = false; boolean menuactive = false; boolean fromlevelselect = false; +boolean menu_text_input = false; + static INT32 coolalphatimer = 9; typedef enum @@ -3514,6 +3516,7 @@ boolean M_Responder(event_t *ev) // Handle menuitems which need a specific key handling if (routine && (currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_KEYHANDLER) { + menu_text_input = true; if (shiftdown && ch >= 32 && ch <= 127) ch = shiftxform[ch]; routine(ch); @@ -3554,7 +3557,7 @@ boolean M_Responder(event_t *ev) { if ((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_STRING) { - + menu_text_input = true; if (shiftdown && ch >= 32 && ch <= 127) ch = shiftxform[ch]; if (M_ChangeStringCvar(ch)) diff --git a/src/m_menu.h b/src/m_menu.h index 8d1ebb723..9a4cc1e92 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -91,6 +91,8 @@ void M_QuitResponse(INT32 ch); // Determines whether to show a level in the list boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt); +extern boolean menu_text_input; + // flags for items in the menu // menu handle (what we do when key is pressed #define IT_TYPE 14 // (2+4+8) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 61f30b436..2b3d6d365 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -75,6 +75,7 @@ #include "../command.h" #include "sdlmain.h" #include "../i_system.h" +#include "../hu_stuff.h" // for chat_on #ifdef HWRENDER #include "../hardware/hw_main.h" #include "../hardware/hw_drv.h" @@ -848,7 +849,7 @@ static void Impl_HandleKeyboardEvent(SDL_KeyboardEvent evt, Uint32 type) return; } - if (cv_nativekeyboard.value) + if (cv_nativekeyboard.value && (chat_on || CON_Ready() || menu_text_input)) //only use this this if on chat or console event.data1 = GetTypedChar(evt.keysym.scancode, &evt.keysym); else event.data1 = Impl_SDL_Scancode_To_Keycode(evt.keysym.scancode);