X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f97d84a63b21fffcc830390e5bc3fe0eedb6e15b..c3357374af44fdcae9d326e62ab5a39d9517102d:/contrib/src/stc/stc.cpp diff --git a/contrib/src/stc/stc.cpp b/contrib/src/stc/stc.cpp index 3573c3f648..a362eaf491 100644 --- a/contrib/src/stc/stc.cpp +++ b/contrib/src/stc/stc.cpp @@ -1539,16 +1539,38 @@ void wxStyledTextCtrl::OnMouseRightUp(wxMouseEvent& evt) { m_swx->DoContextMenu(Point(pt.x, pt.y)); } + void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) { long key = evt.KeyCode(); - if ((key > WXK_ESCAPE) && - (key != WXK_DELETE) && (key < 255) && - !evt.ControlDown() && !evt.AltDown()) { - - m_swx->DoAddChar(key); - } - else { - evt.Skip(); + switch (key) { + // Special handling for charcters that must be typed with AltGr down on + // foreign keyboards. (Comes to us as Ctrl+Alt, and so would get + // filtered out by the default case below.) + // + // There should be a better way to do this... + // + case '\\': + case '|': + case '@': + case '#': + case '¬': + case '[': + case ']': + case '{': + case '}': + case '?': + m_swx->DoAddChar(key); + break; + + default: + if ((key > WXK_ESCAPE) && (key != WXK_DELETE) && (key < 255) && + !evt.ControlDown() && !evt.AltDown()) { + + m_swx->DoAddChar(key); + } + else { + evt.Skip(); + } } } @@ -1561,6 +1583,7 @@ void wxStyledTextCtrl::OnKeyDown(wxKeyEvent& evt) { evt.Skip(); } + void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent& evt) { m_swx->DoLoseFocus(); }