aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2011-06-15 23:07:00 +1000
committernyamatongwe <devnull@localhost>2011-06-15 23:07:00 +1000
commit42b2771fab341485972a3084bba49d1f91137d34 (patch)
tree31d8dfd3e22f066b94bcbe741ad6f05a5ac9711e /src
parent3effc9e6e4668dc6100d70e76a03a63d5248f7f0 (diff)
downloadscintilla-mirror-42b2771fab341485972a3084bba49d1f91137d34.tar.gz
Added SCMOD_META key modifier for the Control key on OS X.
New version of KeyDown, KeyDownWithModifiers uses a mask of modifiers.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx10
-rw-r--r--src/Editor.h1
2 files changed, 8 insertions, 3 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 587aa8050..648dd8034 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -5516,10 +5516,8 @@ int Editor::KeyDefault(int, int) {
return 0;
}
-int Editor::KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed) {
+int Editor::KeyDownWithModifiers(int key, int modifiers, bool *consumed) {
DwellEnd(false);
- int modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
- (alt ? SCI_ALT : 0);
int msg = kmap.Find(key, modifiers);
if (msg) {
if (consumed)
@@ -5532,6 +5530,12 @@ int Editor::KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed) {
}
}
+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);
+ return KeyDownWithModifiers(key, modifiers, consumed);
+}
+
void Editor::SetWhitespaceVisible(int view) {
vs.viewWhitespace = static_cast<WhiteSpaceVisibility>(view);
}
diff --git a/src/Editor.h b/src/Editor.h
index eccdb717f..74f0eff86 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -465,6 +465,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
int StartEndDisplayLine(int pos, bool start);
virtual int KeyCommand(unsigned int iMessage);
virtual int KeyDefault(int /* key */, int /*modifiers*/);
+ int KeyDownWithModifiers(int key, int modifiers, bool *consumed);
int KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed=0);
int GetWhitespaceVisible();