only use this for text inputs not gameplay

This commit is contained in:
Alug committed 2024-03-04 18:34:26 +01:00
1 parent 16078d7f2d
commit 774caadc79
3 files changed
+8 -2

No files matched your search

+4 -1
View File
@@ -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))
+2
View File
@@ -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)
+2 -1
View File
@@ -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);