]> git.saurik.com Git - wxWidgets.git/commitdiff
Ignore WXK_NONE events in wxStyledTextCtrl.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 28 Nov 2011 13:34:16 +0000 (13:34 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 28 Nov 2011 13:34:16 +0000 (13:34 +0000)
Scintilla use of 0 indicating "modifier key" conflicts with our use of
WXK_NONE indicating absence of a valid key code. As Scintilla can't do
anything with the keys without a key code anyhow, simply ignore them
immediately, without passing them to Scintilla, in DoKeyDown().

This fixes handling of IME input in wxStyledTextCtrl under MSW and possibly
other problems (e.g. with dead char keys).

Closes #13570.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69857 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/stc/ScintillaWX.cpp

index 6d6856895bad123cfa56705ad031e06c1b8a523d..8241114798dd8bf894d46374691d748a259240a2 100644 (file)
@@ -919,6 +919,14 @@ void ScintillaWX::DoAddChar(int key) {
 int  ScintillaWX::DoKeyDown(const wxKeyEvent& evt, bool* consumed)
 {
     int key = evt.GetKeyCode();
+    if (key == WXK_NONE) {
+        // This is a Unicode character not representable in Latin-1 or some key
+        // without key code at all (e.g. dead key or VK_PROCESSKEY under MSW).
+        if ( consumed )
+            *consumed = false;
+        return 0;
+    }
+
     bool shift = evt.ShiftDown(),
          ctrl  = evt.ControlDown(),
          alt   = evt.AltDown();