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
This commit is contained in:
Vadim Zeitlin 2011-11-28 13:34:16 +00:00
parent 1d8d3cc5a1
commit 836499118f

View 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();