mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Update client/eventsSDL/InputSourceKeyboard.cpp
Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
This commit is contained in:
@@ -33,11 +33,14 @@ void InputSourceKeyboard::handleEventKeyDown(const SDL_KeyboardEvent & key)
|
|||||||
{
|
{
|
||||||
if (SDL_IsTextInputActive() == SDL_TRUE)
|
if (SDL_IsTextInputActive() == SDL_TRUE)
|
||||||
{
|
{
|
||||||
if(key.keysym.sym == SDLK_v && isKeyboardCtrlDown()) {
|
if(key.keysym.sym == SDLK_v && isKeyboardCtrlDown())
|
||||||
std::string clipboardContent = SDL_GetClipboardText();
|
{
|
||||||
|
char * clipboardBuffer = SDL_GetClipboardText();
|
||||||
|
std::string clipboardContent = clipboardBuffer;
|
||||||
boost::erase_all(clipboardContent, "\r");
|
boost::erase_all(clipboardContent, "\r");
|
||||||
boost::erase_all(clipboardContent, "\n");
|
boost::erase_all(clipboardContent, "\n");
|
||||||
GH.events().dispatchTextInput(clipboardContent);
|
GH.events().dispatchTextInput(clipboardContent);
|
||||||
|
SDL_free(clipboardBuffer);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user