aboutsummaryrefslogtreecommitdiff
path: root/engines/gargoyle
diff options
context:
space:
mode:
authorPaul Gilbert2018-11-08 22:06:26 -0800
committerPaul Gilbert2018-12-08 19:05:59 -0800
commitd6538380d7afe31b571945bf642496a08af09dfc (patch)
tree7989f160aeec2a0c585f3114eb973fe93ebc4818 /engines/gargoyle
parent65167bd202f20e345bc9cdb2f0fe36c5abe28fe3 (diff)
downloadscummvm-rg350-d6538380d7afe31b571945bf642496a08af09dfc.tar.gz
scummvm-rg350-d6538380d7afe31b571945bf642496a08af09dfc.tar.bz2
scummvm-rg350-d6538380d7afe31b571945bf642496a08af09dfc.zip
GLK: Implemented pasting from clipboard
Diffstat (limited to 'engines/gargoyle')
-rw-r--r--engines/gargoyle/clipboard.cpp14
1 files changed, 13 insertions, 1 deletions
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