diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 11 | ||||
-rw-r--r-- | src/Editor.h | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index dd4551735..3761154f3 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2296,14 +2296,19 @@ int Editor::KeyDefault(int, int) { return 0; } -int Editor::KeyDown(int key, bool shift, bool ctrl, bool alt) { +int Editor::KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed) { int modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) | (alt ? SCI_ALT : 0); int msg = kmap.Find(key, modifiers); - if (msg) + if (msg) { + if (consumed) + *consumed = true; return WndProc(msg, 0, 0); - else + } else { + if (consumed) + *consumed = false; return KeyDefault(key, modifiers); + } } void Editor::SetWhitespaceVisible(int view) { diff --git a/src/Editor.h b/src/Editor.h index 1d0b47c56..3733aedc1 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -258,7 +258,7 @@ protected: // ScintillaBase subclass needs access to much of Editor virtual void CancelModes(); virtual int KeyCommand(unsigned int iMessage); virtual int KeyDefault(int /* key */, int /*modifiers*/); - int KeyDown(int key, bool shift, bool ctrl, bool alt); + int KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed=0); int GetWhitespaceVisible(); void SetWhitespaceVisible(int view); |