Skip to content

Commit

Permalink
CTRL-only bindings now also consider SHIFT-pressed in addition to ALT.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Jeroen Verburgh authored and dail8859 committed May 14, 2022
1 parent 0a0ee31 commit f9f54d3
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f9f54d3

Please sign in to comment.