diff options
-rw-r--r-- | doc/ScintillaDoc.html | 4 | ||||
-rw-r--r-- | doc/ScintillaHistory.html | 5 | ||||
-rw-r--r-- | gtk/ScintillaGTK.cxx | 8 | ||||
-rw-r--r-- | src/Editor.cxx | 5 | ||||
-rw-r--r-- | src/Editor.h | 2 | ||||
-rw-r--r-- | src/KeyMap.h | 1 |
6 files changed, 16 insertions, 9 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index b1b550fb0..f1e6c3a75 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -5042,9 +5042,11 @@ 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>, <code>SCMOD_SHIFT</code>, and <code>SCMOD_META</code>. + <code>SCMOD_CTRL</code>, <code>SCMOD_SHIFT</code>, + <code>SCMOD_META</code>, and <code>SCMOD_SUPER</code>. On OS X, the Command key is mapped to <code>SCMOD_CTRL</code> and the Control key to <code>SCMOD_META</code>. + <code>SCMOD_SUPER</code> is only available on GTK+ which is commonly the Windows key. 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> diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 71886307e..a3e725230 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -484,6 +484,7 @@ </tr><tr> <td>Mark C</td> <td>Johannes Sasongko</td> + <td>fstirlitz</td> </tr> </table> <p> @@ -515,6 +516,10 @@ <a href="http://sourceforge.net/p/scintilla/bugs/1822/">Bug #1822</a>. </li> <li> + For GTK+, the Super modifier key can be used in key bindings. + <a href="http://sourceforge.net/p/scintilla/feature-requests/1142/">Feature #1142.</a> + </li> + <li> SciTE bug fixed with exported HTML where extra line shown. <a href="http://sourceforge.net/p/scintilla/bugs/1816/">Bug #1816</a>. </li> diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 25e160510..ad9aa6568 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -2192,6 +2192,7 @@ gboolean ScintillaGTK::KeyThis(GdkEventKey *event) { bool shift = (event->state & GDK_SHIFT_MASK) != 0; bool ctrl = (event->state & GDK_CONTROL_MASK) != 0; bool alt = (event->state & GDK_MOD1_MASK) != 0; + bool super = (event->state & GDK_MOD4_MASK) != 0; guint key = event->keyval; if ((ctrl || alt) && (key < 128)) key = toupper(key); @@ -2208,15 +2209,12 @@ gboolean ScintillaGTK::KeyThis(GdkEventKey *event) { bool consumed = false; #if !(PLAT_GTK_MACOSX) - bool added = KeyDown(key, shift, ctrl, alt, &consumed) != 0; + bool meta = false; #else bool meta = ctrl; ctrl = (event->state & GDK_META_MASK) != 0; - bool added = KeyDownWithModifiers(key, (shift ? SCI_SHIFT : 0) | - (ctrl ? SCI_CTRL : 0) | - (alt ? SCI_ALT : 0) | - (meta ? SCI_META : 0), &consumed) != 0; #endif + bool added = KeyDownWithModifiers(key, ModifierFlags(shift, ctrl, alt, meta, super), &consumed) != 0; if (!consumed) consumed = added; //fprintf(stderr, "SK-key: %d %x %x\n",event->keyval, event->state, consumed); diff --git a/src/Editor.cxx b/src/Editor.cxx index b480287c3..eddc0e623 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2265,12 +2265,13 @@ void Editor::DelCharBack(bool allowLineStartDeletion) { ShowCaretAtCurrentPosition(); } -int Editor::ModifierFlags(bool shift, bool ctrl, bool alt, bool meta) { +int Editor::ModifierFlags(bool shift, bool ctrl, bool alt, bool meta, bool super) { return (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) | (alt ? SCI_ALT : 0) | - (meta ? SCI_META : 0); + (meta ? SCI_META : 0) | + (super ? SCI_SUPER : 0); } void Editor::NotifyFocus(bool focus) { diff --git a/src/Editor.h b/src/Editor.h index 67aad42d7..9cc648e84 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -414,7 +414,7 @@ protected: // ScintillaBase subclass needs access to much of Editor void DelCharBack(bool allowLineStartDeletion); virtual void ClaimSelection() = 0; - static int ModifierFlags(bool shift, bool ctrl, bool alt, bool meta=false); + static int ModifierFlags(bool shift, bool ctrl, bool alt, bool meta=false, bool super=false); virtual void NotifyChange() = 0; virtual void NotifyFocus(bool focus); virtual void SetCtrlID(int identifier); diff --git a/src/KeyMap.h b/src/KeyMap.h index b102b356f..7c4f80720 100644 --- a/src/KeyMap.h +++ b/src/KeyMap.h @@ -17,6 +17,7 @@ namespace Scintilla { #define SCI_CTRL SCMOD_CTRL #define SCI_ALT SCMOD_ALT #define SCI_META SCMOD_META +#define SCI_SUPER SCMOD_SUPER #define SCI_CSHIFT (SCI_CTRL | SCI_SHIFT) #define SCI_ASHIFT (SCI_ALT | SCI_SHIFT) |