Merge branch 'Saturn-Next' into refactorogl

This commit is contained in:
Alug committed 2024-10-31 11:59:33 +01:00
commit 7ddcf6d0d4
1 file changed
+16 -5
+16 -5
View File
@@ -118,6 +118,15 @@ static void M_TextInputToWordBegin(textinput_t *input, boolean move_sel)
if (move_sel) input->select = input->cursor;
}
static void M_TextInputPaste(textinput_t *input)
{
const char *paste = I_ClipboardPaste();
if (input->select != input->cursor)
M_TextInputDelSelection(input);
if (paste != NULL)
M_TextInputAddString(input, paste);
}
void M_TextInputInit(textinput_t *input, char *buffer, size_t buffer_size)
{
input->buffer = buffer;
@@ -147,6 +156,12 @@ boolean M_TextInputHandle(textinput_t *input, INT32 key)
|| key == KEY_LALT || key == KEY_RALT)
return false;
if (shiftdown && key == KEY_INS)
{
M_TextInputPaste(input);
return true;
}
if ((cv_keyboardlayout.value != 3 && ctrldown) || (cv_keyboardlayout.value == 3 && ctrldown && !altdown))
{
if (key == 'x' || key == 'X')
@@ -168,11 +183,7 @@ boolean M_TextInputHandle(textinput_t *input, INT32 key)
}
else if (key == 'v' || key == 'V')
{
const char *paste = I_ClipboardPaste();
if (input->select != input->cursor)
M_TextInputDelSelection(input);
if (paste != NULL)
M_TextInputAddString(input, paste);
M_TextInputPaste(input);
return true;
}
else if (key == 'w' || key == 'W')