Apparently the source code of scintilla itself ignores the event.
I have created a patch and now the event gets detected.
Not sure why such a simple piece of functionality was left out by the
scintilla guys :/
diff -rc Wx-Scintilla-0.3801/wx-scintilla/src/scintilla/src/Editor.cxx Wx-Scintilla-0.3801_mod/wx-scintilla/src/scintilla/src/Editor.cxx
*** Wx-Scintilla-0.3801/wx-scintilla/src/scintilla/src/Editor.cxx 2012-03-26 13:55:41.000000000 +0000
--- Wx-Scintilla-0.3801_mod/wx-scintilla/src/scintilla/src/Editor.cxx 2012-08-26 13:17:36.762809170 +0000
***************
*** 4392,4397 ****
--- 4392,4409 ----
NotifyParent(scn);
}
+ void Editor::NotifyKey(int ch, bool shift, bool ctrl, bool alt) {
+ if(ch == 0) {
+ return;
+ }
+ SCNotification scn = {0};
+ scn.nmhdr.code = SCN_KEY;
+ scn.ch = ch;
+ scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
+ (alt ? SCI_ALT : 0);
+ NotifyParent(scn);
+ }
+
void Editor::NotifySavePoint(bool isSavePoint) {
SCNotification scn = {0};
if (isSavePoint) {
***************
*** 5619,5626 ****
}
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);
}
--- 5631,5639 ----
}
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);
+ NotifyKey(key,shift,ctrl,alt);
return KeyDownWithModifiers(key, modifiers, consumed);
}
diff -rc Wx-Scintilla-0.3801/wx-scintilla/src/scintilla/src/Editor.h Wx-Scintilla-0.3801_mod/wx-scintilla/src/scintilla/src/Editor.h
*** Wx-Scintilla-0.3801/wx-scintilla/src/scintilla/src/Editor.h 2012-03-26 13:55:41.000000000 +0000
--- Wx-Scintilla-0.3801_mod/wx-scintilla/src/scintilla/src/Editor.h 2012-08-26 12:43:07.472853855 +0000
***************
*** 429,434 ****
--- 429,435 ----
virtual void NotifyParent(SCNotification scn) = 0;
virtual void NotifyStyleToNeeded(int endStyleNeeded);
void NotifyChar(int ch);
+ void NotifyKey(int ch, bool shift, bool ctrl, bool alt);
void NotifySavePoint(bool isSavePoint);
void NotifyModifyAttempt();
virtual void NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt);