+@interface wxNSPanel : NSPanel
+{
+}
+
+- (void)noResponderFor: (SEL) selector;
+- (void)sendEvent:(NSEvent *)event;
+@end
+
+@implementation wxNSPanel
+
+- (BOOL)canBecomeKeyWindow
+{
+ return YES;
+}
+
+- (void)doCommandBySelector:(SEL)selector
+{
+ if (shouldHandleSelector(selector))
+ [super doCommandBySelector:selector];
+}
+
+// NB: if we don't do this, it seems that all events that end here lead to a NSBeep
+- (void)noResponderFor: (SEL) selector
+{
+ if (selector != @selector(keyDown:) && selector != @selector(keyUp:))
+ {
+ [super noResponderFor:selector];
+ }
+}
+
+- (void)sendEvent:(NSEvent *) event
+{
+ if ( ![self WX_filterSendEvent: event] )
+ [super sendEvent: event];
+}