@@ -78,9 +78,12 @@ - (void)setHandlingSendEvent:(BOOL)handlingSendEvent {
7878
7979- (void )sendEvent : (NSEvent *)event {
8080 if ([event type ] == NSKeyDown ) {
81- // We've removed cut, copy, paste from the edit menu,
82- // so we handle those shortcuts explicitly.
83- if ([event modifierFlags ] & NSCommandKeyMask ) {
81+ // If mainWindow is the first responder then cef isn't the target
82+ // so let the application event chain handle it intrinsically
83+ if ([[self mainWindow ] firstResponder ] == [self mainWindow ] &&
84+ [event modifierFlags ] & NSCommandKeyMask ) {
85+ // We've removed cut, copy, paste from the edit menu,
86+ // so we handle those shortcuts explicitly.
8487 SEL theSelector = nil ;
8588 NSString *keyStr = [event charactersIgnoringModifiers ];
8689 unichar keyChar = [keyStr characterAtIndex: 0 ];
@@ -91,11 +94,7 @@ - (void)sendEvent:(NSEvent*)event {
9194 } else if (keyChar == ' x' ){
9295 theSelector = NSSelectorFromString (@" cut:" );
9396 } else if (keyChar == ' a' ){
94- // If mainWindow is the first responder then cef isn't the target
95- // so let the application event chain handle it intrinsically
96- if ([[self mainWindow ] firstResponder ] == [self mainWindow ]) {
97- theSelector = NSSelectorFromString (@" selectAll:" );
98- }
97+ theSelector = NSSelectorFromString (@" selectAll:" );
9998 }
10099 if (theSelector != nil ) {
101100 [[NSApplication sharedApplication ] sendAction: theSelector to: nil from: nil ];
0 commit comments