mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Add editor copy & paste
This commit is contained in:
parent
6e74d9d728
commit
50236ca45c
|
@ -392,6 +392,23 @@ int CEditor::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned Str
|
|||
int NumChars = Len;
|
||||
ReturnValue |= CLineInput::Manipulate(Input()->GetEvent(i), pStr, StrSize, StrSize, &Len, &s_AtIndex, &NumChars);
|
||||
}
|
||||
|
||||
if(Input()->KeyIsPressed(KEY_LCTRL) && Input()->KeyPress(KEY_V))
|
||||
{
|
||||
const char *pClipboardText = Input()->GetClipboardText();
|
||||
if(pClipboardText)
|
||||
{
|
||||
str_append(pStr, pClipboardText, StrSize);
|
||||
str_sanitize_cc(pStr);
|
||||
s_AtIndex = str_length(pStr);
|
||||
ReturnValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(Input()->KeyIsPressed(KEY_LCTRL) && Input()->KeyPress(KEY_C) && pStr[0] != '\0')
|
||||
{
|
||||
Input()->SetClipboardText(pStr);
|
||||
}
|
||||
}
|
||||
|
||||
bool JustGotActive = false;
|
||||
|
|
Loading…
Reference in a new issue