+#endif
+
+ case KeyPress:
+ {
+ if (!win->IsEnabled())
+ return false;
+
+ wxKeyEvent keyEvent(wxEVT_KEY_DOWN);
+ wxTranslateKeyEvent(keyEvent, win, window, event);
+
+ // wxLogDebug( "OnKey from %s", win->GetName().c_str() );
+
+ // We didn't process wxEVT_KEY_DOWN, so send wxEVT_CHAR
+ if (win->HandleWindowEvent( keyEvent ))
+ return true;
+
+ keyEvent.SetEventType(wxEVT_CHAR);
+ // Do the translation again, retaining the ASCII
+ // code.
+ if (wxTranslateKeyEvent(keyEvent, win, window, event, true) &&
+ win->HandleWindowEvent( keyEvent ))
+ return true;
+
+ if ( (keyEvent.m_keyCode == WXK_TAB) &&
+ win->GetParent() && (win->GetParent()->HasFlag( wxTAB_TRAVERSAL)) )
+ {
+ wxNavigationKeyEvent new_event;
+ new_event.SetEventObject( win->GetParent() );
+ /* GDK reports GDK_ISO_Left_Tab for SHIFT-TAB */
+ new_event.SetDirection( (keyEvent.m_keyCode == WXK_TAB) );
+ /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */
+ new_event.SetWindowChange( keyEvent.ControlDown() );
+ new_event.SetCurrentFocus( win );
+ return win->GetParent()->HandleWindowEvent( new_event );
+ }
+
+ return false;
+ }
+ case KeyRelease: