diff options
-rw-r--r-- | doc/ScintillaDoc.html | 5 | ||||
-rw-r--r-- | include/Scintilla.h | 1 | ||||
-rw-r--r-- | include/Scintilla.iface | 1 | ||||
-rw-r--r-- | src/Editor.cxx | 10 | ||||
-rw-r--r-- | src/Editor.h | 1 |
5 files changed, 14 insertions, 4 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 1e541bbb8..5ba329876 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -4446,7 +4446,10 @@ struct Sci_TextToFind { <code>SCK_WIN</code>.</p> <p>The modifiers are a combination of zero or more of <code>SCMOD_ALT</code>, - <code>SCMOD_CTRL</code>, and <code>SCMOD_SHIFT</code>. If you are building a table, you might + <code>SCMOD_CTRL</code>, <code>SCMOD_SHIFT</code>, and <code>SCMOD_META</code>. + On OS X, the Command key is mapped to <code>SCMOD_CTRL</code> and the Control key to + <code>SCMOD_META</code>. + If you are building a table, you might want to use <code>SCMOD_NORM</code>, which has the value 0, to mean no modifiers.</p> <p><b id="SCI_ASSIGNCMDKEY">SCI_ASSIGNCMDKEY(int <a class="jump" diff --git a/include/Scintilla.h b/include/Scintilla.h index 6c0c7342d..e9620600c 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -886,6 +886,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCMOD_CTRL 2 #define SCMOD_ALT 4 #define SCMOD_SUPER 8 +#define SCMOD_META 16 #define SCN_STYLENEEDED 2000 #define SCN_CHARADDED 2001 #define SCN_SAVEPOINTREACHED 2002 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index f21ee3e42..cf6623280 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -2293,6 +2293,7 @@ val SCMOD_SHIFT=1 val SCMOD_CTRL=2 val SCMOD_ALT=4 val SCMOD_SUPER=8 +val SCMOD_META=16 ################################################ # For SciLexer.h 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(); |