diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index ef8b5b62a..8f72adf6b 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -6,14 +6,13 @@ Copyright (c) 2002-2024 Various contributors (see below, and AUTHORS.txt) https://tuxpaint.org/ -2024.December.20 (0.9.35) +2024.December.25 (0.9.35) * Text & Label Tool Improvements: ------------------------------- + WIP It is now possible to paste text from the copy/paste clipboard into Tux Paint. If text goes beyond the right of the canvas, a new line is created. If text goes beyond the bottom of the canvas, the text is truncated there. - - WIP: Add a "paste" button to the On Screen Keyboards - TODO: Improve word-wrapping (word-based, not character) - TODO: Mention the feature in documentation Closes https://sourceforge.net/p/tuxpaint/feature-requests/95/ diff --git a/src/onscreen_keyboard.c b/src/onscreen_keyboard.c index 20871b507..81cb79e74 100644 --- a/src/onscreen_keyboard.c +++ b/src/onscreen_keyboard.c @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - Last modified: December 19, 2024 + Last modified: December 25, 2024 */ #include "debug.h" @@ -1900,6 +1900,11 @@ struct osk_keyboard *osk_clicked(on_screen_keyboard *keyboard, int x, int y) event.text.text[0] = '\b'; event.text.text[1] = '\0'; } + else if (wcsncmp(L"XF86Paste", ks, 9) == 0) + { + event.key.keysym.sym = SDLK_PASTE; + event.text.text[0] = '\0'; // FIXME: Is this okay? -bjk 2024.12.25 + } else if (wcsncmp(L"NoSymbol", ks, 8) == 0) { return (keyboard); diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 9ff87b9a8..0f5e7bf00 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -3155,7 +3155,7 @@ static void mainloop(void) update_screen_rect(&r_tools); } } - else if ((key == SDLK_v && (mod & KMOD_CTRL)) && !noshortcuts) + else if (((key == SDLK_v && (mod & KMOD_CTRL)) && !noshortcuts) || key == SDLK_PASTE) { /* Ctrl-V - Paste */ if (cur_tool == TOOL_TEXT || cur_tool == TOOL_LABEL) @@ -3220,7 +3220,7 @@ static void mainloop(void) || event.key.keysym.sym == SDLK_TAB || event.key.keysym.sym == SDLK_LALT || event.key.keysym.sym == SDLK_RALT))) { - /* Handle key in text tool: */ + /* Handle special keys key in text tool: */ if (((cur_tool == TOOL_TEXT || cur_tool == TOOL_LABEL) && cursor_x != -1 && cursor_y != -1) || (cur_tool == TOOL_LABEL