|
|
@ -511,11 +511,15 @@ hsBool pfGUIEditBoxMod::HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef |
|
|
|
else if (key == KEY_V) |
|
|
|
else if (key == KEY_V) |
|
|
|
{ |
|
|
|
{ |
|
|
|
wchar_t* contents = plClipboard::GetInstance().GetClipboardText(); |
|
|
|
wchar_t* contents = plClipboard::GetInstance().GetClipboardText(); |
|
|
|
|
|
|
|
if (contents != nil)
|
|
|
|
|
|
|
|
{ |
|
|
|
size_t len = wcslen(contents); |
|
|
|
size_t len = wcslen(contents); |
|
|
|
if (len > 0) { |
|
|
|
if (len > 0)
|
|
|
|
|
|
|
|
{ |
|
|
|
wchar_t* insertTarget = fBuffer + fCursorPos; |
|
|
|
wchar_t* insertTarget = fBuffer + fCursorPos; |
|
|
|
size_t bufferTailLen = wcslen(insertTarget); |
|
|
|
size_t bufferTailLen = wcslen(insertTarget); |
|
|
|
if (fCursorPos + len + bufferTailLen < fBufferSize) { |
|
|
|
if (fCursorPos + len + bufferTailLen < fBufferSize)
|
|
|
|
|
|
|
|
{ |
|
|
|
memmove(insertTarget + len, insertTarget, bufferTailLen * sizeof(wchar_t)); |
|
|
|
memmove(insertTarget + len, insertTarget, bufferTailLen * sizeof(wchar_t)); |
|
|
|
memcpy(insertTarget, contents, len * sizeof(wchar_t)); |
|
|
|
memcpy(insertTarget, contents, len * sizeof(wchar_t)); |
|
|
|
fCursorPos += len; |
|
|
|
fCursorPos += len; |
|
|
@ -525,6 +529,7 @@ hsBool pfGUIEditBoxMod::HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef |
|
|
|
delete contents; |
|
|
|
delete contents; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
fIgnoreNextKey = false; |
|
|
|
fIgnoreNextKey = false; |
|
|
|