Set modifiers properly for the key events with AltGr in wxGTK.

Just as under Windows, represent AltGr as a combination of wxMOD_CONTROL and
wxMOD_ALT.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2012-09-09 13:36:20 +00:00
parent 44b7211689
commit 82213cb04e

View File

@ -666,6 +666,16 @@ static void wxFillOtherKeyEventFields(wxKeyEvent& event,
event.m_altDown = (gdk_event->state & GDK_MOD1_MASK) != 0;
event.m_metaDown = (gdk_event->state & GDK_META_MASK) != 0;
// At least with current Linux systems, MOD5 corresponds to AltGr key and
// we represent it, for consistency with Windows, which really allows to
// use Ctrl+Alt as a replacement for AltGr if this key is not present, as a
// combination of these two modifiers.
if ( gdk_event->state & GDK_MOD5_MASK )
{
event.m_controlDown =
event.m_altDown = true;
}
// Normally we take the state of modifiers directly from the low level GDK
// event but unfortunately GDK uses a different convention from MSW for the
// key events corresponding to the modifier keys themselves: in it, when