From d66f640c8122d841ef80bf24b2567392787d18aa Mon Sep 17 00:00:00 2001 From: RadAd Date: Thu, 18 Jul 2019 12:58:53 +1000 Subject: Fix up ctrl+c copy --- RadTerminal.cpp | 9 ++++----- RadTerminal.rc | Bin 9742 -> 9468 bytes RadTerminalFrame.cpp | 2 +- resource.h | Bin 3924 -> 3830 bytes 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/RadTerminal.cpp b/RadTerminal.cpp index b009d48..591e87f 100644 --- a/RadTerminal.cpp +++ b/RadTerminal.cpp @@ -1029,9 +1029,11 @@ void RadTerminalWindowSendKey(HWND hWnd, UINT vk, UINT scan, bool extended) //case VK_: keysym = XKB_KEY_R15; break; } - tsm_screen_selection_reset(data->screen); if (vk != VK_SHIFT && vk != VK_CONTROL && vk != VK_MENU) + { + tsm_screen_selection_reset(data->screen); tsm_screen_sb_reset(data->screen); + } if (keysym != XKB_KEY_NoSymbol) tsm_vte_handle_keyboard(data->vte, keysym, ascii, mods, unicode); InvalidateRect(hWnd, nullptr, TRUE); @@ -1041,14 +1043,12 @@ void RadTerminalWindowOnKeyDown(HWND hWnd, UINT vk, BOOL fDown, int cRepeat, UIN { FORWARD_WM_KEYDOWN(hWnd, vk, cRepeat, flags, MyDefWindowProc); - BYTE KeyState[256]; - GetKeyboardState(KeyState); - bool bPassOn = true; switch (vk) { case VK_ESCAPE: bPassOn = ActionClearSelection(hWnd) < 0; break; case VK_RETURN: bPassOn = ActionCopyToClipboard(hWnd) < 0; break; + case 'C': if (GetKeyState(VK_CONTROL) & 0x80) bPassOn = ActionCopyToClipboard(hWnd) < 0; break; } if (bPassOn) @@ -1252,7 +1252,6 @@ void RadTerminalWindowOnCommand(HWND hWnd, int id, HWND hWndCtl, UINT codeNotify { switch (id) { - case ID_EDIT_COPY: ActionCopyToClipboard(hWnd); break; case ID_EDIT_PASTE: ActionPasteFromClipboard(hWnd); break; case ID_VIEW_SCROLL_UP: ActionScrollbackUp(hWnd); break; case ID_VIEW_SCROLL_DOWN: ActionScrollbackDown(hWnd); break; diff --git a/RadTerminal.rc b/RadTerminal.rc index 1cebf60..0df0162 100644 Binary files a/RadTerminal.rc and b/RadTerminal.rc differ diff --git a/RadTerminalFrame.cpp b/RadTerminalFrame.cpp index 0fecff6..58a7563 100644 --- a/RadTerminalFrame.cpp +++ b/RadTerminalFrame.cpp @@ -144,7 +144,7 @@ void RadTerminalFrameOnCommand(HWND hWnd, int id, HWND hWndCtl, UINT codeNotify) case ID_WINDOW_TILEHORIZONTALLY: TileWindows(hWndMDIClient, MDITILE_HORIZONTAL, nullptr, 0, nullptr); break; case ID_WINDOW_TILEVERTICALLY: TileWindows(hWndMDIClient, MDITILE_VERTICAL, nullptr, 0, nullptr); break; - case ID_EDIT_COPY: case ID_EDIT_PASTE: + case ID_EDIT_PASTE: case ID_VIEW_SCROLL_UP: case ID_VIEW_SCROLL_DOWN: case ID_FILE_CLOSE: FORWARD_WM_COMMAND(GetMDIActive(hWndMDIClient), id, hWndCtl, codeNotify, SendMessage); break; diff --git a/resource.h b/resource.h index bd4556f..69de8dd 100644 Binary files a/resource.h and b/resource.h differ -- cgit v1.2.3