Trigger the action of NSButton and NSPopUpButton in their keyDown

method only for the Space key.
Fix key view loop of NSAlert panels and NSSavePanel so that all
buttons become reachable with the Tab key.
Make Escape key equivalent of the Cancel button of NSSavePanel.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27011 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
wlux 2008-11-05 23:01:37 +00:00
parent 4b6d5a490a
commit 2282372272
4 changed files with 12 additions and 13 deletions

View file

@ -468,6 +468,14 @@ this to return nil to indicate that we have no context menu.
case NSNewlineCharacter:
case NSEnterCharacter:
case NSCarriageReturnCharacter:
/* Handle Enter and Return keys only when the menu is visible.
The button's action to pop up the menu is initiated only by
the Space key similar to other buttons. */
{
NSMenuView *menuView = [[_cell menu] menuRepresentation];
if ([[menuView window] isVisible] == NO)
break;
}
case ' ':
{
int selectedIndex;