From 014bef9eab9fb409cfb3ec66830e033e4aaa29a9 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Thu, 19 Sep 2019 22:20:08 +0100 Subject: BACKENDS: Add a default clipboard implementation --- engines/glk/selection.cpp | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'engines/glk') diff --git a/engines/glk/selection.cpp b/engines/glk/selection.cpp index 756df02b09..f5ef012fd2 100644 --- a/engines/glk/selection.cpp +++ b/engines/glk/selection.cpp @@ -33,27 +33,23 @@ void Clipboard::clipboardStore(const Common::U32String &text) { } void Clipboard::clipboardSend(ClipSource source) { - if (g_system->hasFeature(OSystem::kFeatureClipboardSupport)) { - // Convert unicode string to standard string, since that's all ScummVM supports - Common::String text; - for (uint idx = 0; idx < _text.size(); ++idx) - text += (_text[idx] <= 0x7f) ? (char)_text[idx] : '?'; + // Convert unicode string to standard string, since that's all ScummVM supports + Common::String text; + for (uint idx = 0; idx < _text.size(); ++idx) + text += (_text[idx] <= 0x7f) ? (char)_text[idx] : '?'; - g_system->setTextInClipboard(text); - } + g_system->setTextInClipboard(text); } void Clipboard::clipboardReceive(ClipSource source) { - if (g_system->hasFeature(OSystem::kFeatureClipboardSupport)) { - 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); - } + 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); } } } -- cgit v1.2.3