diff --git a/ChangeLog b/ChangeLog index fd7d2a325..0d6a0d1dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-04-30 Richard Frith-Macdonald + + * NSMenu.m: ([performKeyEquivalent:]) Ignore key eqivalents other + than carriage return if the command key is not pressed. + 2006-04-30 David Ayers * ColorPickers/GSNamedColorPicker.m ([-browser:selectRow:inColumn:]): diff --git a/Source/NSMenu.m b/Source/NSMenu.m index 63c30dd00..602edc86d 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -964,8 +964,7 @@ static NSNotificationCenter *nc; if ([item hasSubmenu]) { - // FIXME: Should we only check active submenus? - // Recurse through submenus. + // Recurse through submenus whether active or not. if ([[item submenu] performKeyEquivalent: theEvent]) { // The event has been handled by an item in the submenu. @@ -974,15 +973,21 @@ static NSNotificationCenter *nc; } else { - // FIXME: Should also check the modifier mask if ([[item keyEquivalent] isEqualToString: [theEvent charactersIgnoringModifiers]]) { - if ([item isEnabled]) + /* + * Must be carriage return or have the command key modifier + */ + if ([[item keyEquivalent] isEqualToString: @"\r"] + || ([theEvent modifierFlags] & NSCommandKeyMask)) { - [_view performActionWithHighlightingForItemAtIndex: i]; + if ([item isEnabled]) + { + [_view performActionWithHighlightingForItemAtIndex: i]; + } + return YES; } - return YES; } } }