From d6538380d7afe31b571945bf642496a08af09dfc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 8 Nov 2018 22:06:26 -0800 Subject: GLK: Implemented pasting from clipboard --- engines/gargoyle/clipboard.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'engines/gargoyle') diff --git a/engines/gargoyle/clipboard.cpp b/engines/gargoyle/clipboard.cpp index 69ef8f833c..81ef12f5da 100644 --- a/engines/gargoyle/clipboard.cpp +++ b/engines/gargoyle/clipboard.cpp @@ -21,6 +21,9 @@ */ #include "gargoyle/clipboard.h" +#include "gargoyle/gargoyle.h" +#include "gargoyle/windows.h" +#include "common/system.h" namespace Gargoyle { @@ -33,7 +36,16 @@ void Clipboard::send(ClipSource source) { } void Clipboard::receive(ClipSource source) { - // TODO + Windows &windows = *g_vm->_windows; + + if (g_system->hasTextInClipboard()) { + Common::String text = g_system->getTextFromClipboard(); + for (uint idx = 0; idx < text.size(); ++idx) { + uint c = text[idx]; + if (c != '\r' && c != '\n' && c != '\b' && c != '\t') + windows.inputHandleKey(c); + } + } } } // End of namespace Gargoyle -- cgit v1.2.3