Neil Hodgson wrote:
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.

   It may be better to document '0' as meaning propagate or produce an
explicit way to ask for default processing (perhaps SCI_DEFAULT).

I can just call assign with a value of 0 for the message. It does seem odd that clear doesn't undo what assign does, though. I realize that scintilla should capture ESC and not propagate most keys to its gtk parent by default; I just need the ability to configure it not to handle ESC.

And should the test to add a character in
ScintillaGTK::KeyDefault filter out other control keys?

   Only as an option.

Attached is a patch that does this with a #define. It also adds a define to always use input methods, regardless of the encoding. We added this after another report of problems with a keyboard layout and changing to use input methods seems, along with a way to switch between input methods via a widget outside of scintilla seems to have fixed it and we haven't had any reports of problems.

I suspect you may want to undefine both symbols if you commit to cvs.

Thanks,

John
--- /src/scint-cvs/scintilla/gtk/ScintillaGTK.cxx       Mon Nov 21 16:58:08 2005
+++ gtk/ScintillaGTK.cxx        Wed Jan 25 00:11:12 2006
@@ -76,6 +76,11 @@
 #define USE_GTK_CLIPBOARD
 #endif
 
+#if GTK_MAJOR_VERSION >= 2
+#define ALWAYS_USE_INPUT_METHOD
+#define KEY_ADD_ONLY_ISPRINT
+#endif
+
 extern char *UTF8FromLatin1(const char *s, int &len);
 
 class ScintillaGTK : public ScintillaBase {
@@ -1157,6 +1147,9 @@ void ScintillaGTK::NotifyURIDropped(cons
 }
 
 bool ScintillaGTK::UseInputMethod() const {
+#ifdef ALWAYS_USE_INPUT_METHOD
+       return true;
+#else
        switch (vs.styles[STYLE_DEFAULT].characterSet) {
        case SC_CHARSET_CHINESEBIG5:
        case SC_CHARSET_GB2312:
@@ -1171,6 +1164,7 @@ bool ScintillaGTK::UseInputMethod() cons
        default:
                return false;
        }
+#endif
 }
 
 const char *CharacterSetID(int characterSet);
@@ -1272,7 +1258,11 @@ int ScintillaGTK::KeyDefault(int key, in
                        }
                }
 #endif
+#ifdef KEY_ADD_ONLY_ISPRINT
+               if (key < 256 && isprint(key)) {
+#else
                if (key < 256) {
+#endif
                        AddChar(key);
                        return 1;
                } else {
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to