From b92fddeabc4ebfd0d689161a04bae50d32ef3117 Mon Sep 17 00:00:00 2001 From: Indev Date: Mon, 30 Sep 2024 12:08:21 +0300 Subject: [PATCH] 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 --- src/m_textinput.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/m_textinput.c b/src/m_textinput.c index 48ef7d203..8b608cc9a 100644 --- a/src/m_textinput.c +++ b/src/m_textinput.c @@ -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)