diff --git a/ChangeLog b/ChangeLog index 20173bd8c..16796eeb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-04-28 Richard Frith-Macdonald + + * Source/NSApplication.m: ([-sendEvent:]) try key equivalents for + every key down, not just command modifiers ... consistent with + MacOS-X and allows carriage return as a button/menu key. + * Source/NSWindow.m: ([-performKeyEquivalent:]) only pass on to + our views if this is the key window (NSMenu overrides this). + 2006-04-27 Sergii Stoian * Source/NSMenuView.m (-rectOfItemAtIndex:): Delete origin.x fiddling diff --git a/Source/NSApplication.m b/Source/NSApplication.m index 88580642a..78d1f8798 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -1825,23 +1825,22 @@ See -runModalForWindow: case NSKeyDown: { + NSArray *window_list = [self windows]; + unsigned count = [window_list count]; + unsigned i; + NSDebugLLog(@"NSEvent", @"send key down event\n"); - if ([theEvent modifierFlags] & NSCommandKeyMask) + for (i = 0; i < count; i++) { - NSArray *window_list = [self windows]; - unsigned i; - unsigned count = [window_list count]; + NSWindow *window = [window_list objectAtIndex: i]; - for (i = 0; i < count; i++) - { - NSWindow *window = [window_list objectAtIndex: i]; - - if ([window performKeyEquivalent: theEvent] == YES) - break; - } + if ([window performKeyEquivalent: theEvent] == YES) + break; + } + if (i == count) + { + [[theEvent window] sendEvent: theEvent]; } - else - [[theEvent window] sendEvent: theEvent]; break; } diff --git a/Source/NSWindow.m b/Source/NSWindow.m index f989ada74..57eb41c9f 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -2538,7 +2538,7 @@ resetCursorRectsForView(NSView *theView) - (BOOL) performKeyEquivalent: (NSEvent*)theEvent { - if (_contentView) + if ([self isKeyWindow] && _contentView) return [_contentView performKeyEquivalent: theEvent]; return NO; }