Use same keyboardlayout code as in chat for textinput, also add a null terminator after ctrl-v just in case string is not always zeroed out already

This commit is contained in:
indev authored and Alug committed 2024-09-30 15:42:59 +02:00
1 parent 2dddc81713
commit b92fddeabc
1 file changed
+2 -1
+2 -1
View File
@@ -58,6 +58,7 @@ static void M_TextInputAddString(textinput_t *input, const char *c)
memcpy(&input->buffer[input->cursor], c, csize);
input->length += csize;
input->select = (input->cursor += csize);
input->buffer[input->length] = 0;
}
static void M_TextInputAddChar(textinput_t *input, char c)
@@ -288,7 +289,7 @@ boolean M_TextInputHandle(textinput_t *input, INT32 key)
key = '/';
// same capslock code as hu_stuff.c's HU_responder. Check there for details.
key = CON_ShiftChar(key);
key = cv_keyboardlayout.value == 3 ? CON_ShitAndAltGrChar(key) : CON_ShiftChar(key);
// enter a char into the command prompt
if (key < 32 || key > 127)