+void wxButton::OnCharHook(wxKeyEvent& event)
+{
+ // We want to ensure that the button always processes Enter key events
+ // itself, even if it's inside some control that normally takes over them
+ // (this happens when the button is part of an in-place editor control for
+ // example).
+ if ( event.GetKeyCode() == WXK_RETURN )
+ {
+ // We should ensure that subsequent key events are still generated even
+ // if we did handle EVT_CHAR_HOOK (normally this would suppress their
+ // generation).
+ event.DoAllowNextEvent();
+ }
+ else
+ {
+ event.Skip();
+ }
+}
+