diff --git a/source/frontends/sdl/README.md b/source/frontends/sdl/README.md index 2385eaf5..606336f4 100644 --- a/source/frontends/sdl/README.md +++ b/source/frontends/sdl/README.md @@ -36,6 +36,10 @@ Some of the configuration options are exposed in the ``Settings`` menu. This is ``Left Alt`` and ``Right Alt`` emulate the Open and Solid Apple key. +``Shift-Insert`` pastes the clipboard to the input key buffer. + +``Ctrl-Insert`` copies the text screen (in AppleWin this is ``Ctrl-PrintScreen``). + ## Audio Audio works reasonably well, using AppleWin adaptive algorithm. diff --git a/source/frontends/sdl/sdlframe.cpp b/source/frontends/sdl/sdlframe.cpp index 26387c43..801815db 100644 --- a/source/frontends/sdl/sdlframe.cpp +++ b/source/frontends/sdl/sdlframe.cpp @@ -433,6 +433,17 @@ namespace sa2 SDL_free(text); } } + else if (key.keysym.mod & KMOD_CTRL) + { + // in AppleWin this is Ctrl-PrintScreen + // but PrintScreen is not passed to SDL + char *pText; + const size_t size = Util_GetTextScreen(pText); + if (size) + { + SDL_SetClipboardText(pText); + } + } break; } } diff --git a/source/linux/keyboard.cpp b/source/linux/keyboard.cpp index 5e3a249d..fd6bb115 100644 --- a/source/linux/keyboard.cpp +++ b/source/linux/keyboard.cpp @@ -110,10 +110,19 @@ void addTextToBuffer(const char * text) { while (*text) { - if (*text >= 0x20 && *text <= 0x7e) + switch (*text) { - addKeyToBuffer(*text); - ++text; + case '\n': + { + addKeyToBuffer(0x0d); + break; + } + case 0x20 ... 0x7e: + { + addKeyToBuffer(*text); + break; + } } + ++text; } }