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
// will only be sent if it is not in an accelerator table.
if (!ret)
{
- long key_code;
KeySym keysym = gdk_event->keyval;
// Find key code for EVT_CHAR and EVT_CHAR_HOOK events
- key_code = wxTranslateKeySymToWXKey(keysym, true /* isChar */);
+ long key_code = wxTranslateKeySymToWXKey(keysym, true /* isChar */);
if ( !key_code )
{
if ( wxIsAsciiKeysym(keysym) )
wxLogTrace(TRACE_KEYS, wxT("Char event: %ld"), key_code);
eventChar.m_keyCode = key_code;
+#if wxUSE_UNICODE
+ eventChar.m_uniChar = gdk_keyval_to_unicode(key_code);
+#endif // wxUSE_UNICODE
AdjustCharEventKeyCodes(eventChar);