diff options
author | nyamatongwe <devnull@localhost> | 2000-11-08 11:01:31 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2000-11-08 11:01:31 +0000 |
commit | 6fc5151e4fdd7b1f3bc232f5c0ce405aabae1ea4 (patch) | |
tree | d58bbb6464ff6289407fb2cccca039f65b36b31e /src | |
parent | 4eb5bc53a4bf2484b881750db2345847f54f8383 (diff) | |
download | scintilla-mirror-6fc5151e4fdd7b1f3bc232f5c0ce405aabae1ea4.tar.gz |
Changed keystroke handling so that GTK+ stops keys that are mapped to
commands which allows them to propogate up to containers rather than
requiring explicit propogation.
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); |