- if ( (!ret) &&
- (key_code != 0))
- {
- wxKeyEvent event2( wxEVT_CHAR );
- event2.SetTimestamp( gdk_event->time );
- event2.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK);
- event2.m_controlDown = (gdk_event->state & GDK_CONTROL_MASK);
- event2.m_altDown = (gdk_event->state & GDK_MOD1_MASK);
- event2.m_metaDown = (gdk_event->state & GDK_MOD2_MASK);
- event2.m_keyCode = key_code;
- event2.m_scanCode = gdk_event->keyval;
- event2.m_x = x;
- event2.m_y = y;
- event2.SetEventObject( win );
- ret = win->GetEventHandler()->ProcessEvent( event2 );
+ if ( key_code )
+ {
+#ifdef DEBUG_KEY_EVENTS
+ wxPrintf(_T("Char event: %ld\n"), key_code);
+#endif // DEBUG_KEY_EVENTS
+
+ // reuse the ame event object, just change its type and use the
+ // translated keycode instead of the raw one
+ event.SetEventType(wxEVT_CHAR);
+ event.m_keyCode = key_code;
+
+ ret = win->GetEventHandler()->ProcessEvent( event );
+ }