From: Vadim Zeitlin Date: Mon, 28 Nov 2011 13:34:16 +0000 (+0000) Subject: Ignore WXK_NONE events in wxStyledTextCtrl. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/836499118f808b2d2eb11e3ef58690c6c7bf8f6c?hp=1d8d3cc5a1ae14397d1549bd5ad6323e47b3a696 Ignore WXK_NONE events in wxStyledTextCtrl. 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 --- diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index 6d6856895b..8241114798 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -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();