From f9f54d34eed33723466e77118a3e12809f094508 Mon Sep 17 00:00:00 2001 From: Jeroen Verburgh Date: Mon, 9 Aug 2021 13:41:03 +0200 Subject: [PATCH] CTRL-only bindings now also consider SHIFT-pressed in addition to ALT. This prevents CTRL+SHIFT+{} from being handled as CTRL+{}, which in turn allows CLTR+SHIFT+X to be bound to e.g. Edit:UPPERCASE instead of Edit:Cut. --- src/Main.cpp | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/Main.cpp b/src/Main.cpp index da2c685..a00a5fc 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -516,26 +516,28 @@ LRESULT CALLBACK KeyboardProc(int ncode, WPARAM wparam, LPARAM lparam) { EditSelections(SimpleEdit(IsShiftPressed() ? SCI_WORDRIGHTENDEXTEND : SCI_WORDRIGHT)); return TRUE; } - else if (wparam == VK_BACK) { - EditSelections(SimpleEdit(SCI_DELWORDLEFT)); - return TRUE; - } - else if (wparam == VK_DELETE) { - EditSelections(SimpleEdit(SCI_DELWORDRIGHT)); - return TRUE; - } - else if (wparam == 'X' || wparam == 'C') { - if (CopyToClipboard(editor)) { - if (wparam == 'X') { - EditSelections(SimpleEdit(SCI_DELETEBACK)); - } + else if (!IsShiftPressed()) { // Handle CTRL+{} only, allow CTRL+SHIFT+{} to be used elsewhere + if (wparam == VK_BACK) { + EditSelections(SimpleEdit(SCI_DELWORDLEFT)); return TRUE; } - } - else if (wparam == 'V') { - if (Paste(editor)) { + else if (wparam == VK_DELETE) { + EditSelections(SimpleEdit(SCI_DELWORDRIGHT)); return TRUE; } + else if (wparam == 'X' || wparam == 'C') { + if (CopyToClipboard(editor)) { + if (wparam == 'X') { + EditSelections(SimpleEdit(SCI_DELETEBACK)); + } + return TRUE; + } + } + else if (wparam == 'V') { + if (Paste(editor)) { + return TRUE; + } + } } } else {