Hi,
I want to clear the mapping for ESC from the internal keymap and have
the gtk key press event handler return False so that the widget's parent
gets it. The patch is attached -- it treats SCI_NULL the same as 0 in
Editor::KeyDown and avoids adding SCK_ESCAPE to the buffer as a
character in ScintillaGTK::KeyDefault.
Two questions: why is the msg set to SCI_NULL rather to 0 by
SCI_CLEARCMDKEY? And should the test to add a character in
ScintillaGTK::KeyDefault filter out other control keys?
Thanks,
John
Index: gtk/ScintillaGTK.cxx
===================================================================
RCS file: /home/cvs/src/ide/external/scintilla/gtk/ScintillaGTK.cxx,v
retrieving revision 1.43
diff -u -p -r1.43 ScintillaGTK.cxx
--- gtk/ScintillaGTK.cxx 22 Aug 2005 21:41:54 -0000 1.43
+++ gtk/ScintillaGTK.cxx 23 Jan 2006 23:16:29 -0000
@@ -1257,7 +1257,7 @@ int ScintillaGTK::KeyDefault(int key, in
}
}
#endif
- if (key < 256) {
+ if (key != SCK_ESCAPE && key < 256) {
AddChar(key);
return 1;
} else {
Index: src/Editor.cxx
===================================================================
RCS file: /home/cvs/src/ide/external/scintilla/src/Editor.cxx,v
retrieving revision 1.16
diff -u -p -r1.16 Editor.cxx
--- src/Editor.cxx 22 Nov 2005 20:33:25 -0000 1.16
+++ src/Editor.cxx 23 Jan 2006 22:38:04 -0000
@@ -4517,7 +4517,7 @@ int Editor::KeyDown(int key, bool shift,
int modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
(alt ? SCI_ALT : 0);
int msg = kmap.Find(key, modifiers);
- if (msg) {
+ if (msg && msg != SCI_NULL) {
if (consumed)
*consumed = true;
return WndProc(msg, 0, 0);
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest