fix for 67731, patch from varga@utcru.sk, r=pinkerton, sr=hyatt

git-svn-id: svn://10.0.0.236/trunk@90294 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dr%netscape.com
2001-03-24 00:12:47 +00:00
parent 4a449261e5
commit 4737ba6953
2 changed files with 13 additions and 5 deletions

View File

@@ -169,8 +169,10 @@ nsMenuListener::KeyPress(nsIDOMEvent* aKeyEvent)
if (theChar == NS_VK_LEFT ||
theChar == NS_VK_RIGHT ||
theChar == NS_VK_UP ||
theChar == NS_VK_DOWN) {
// The arrow keys were pressed. User is moving around within
theChar == NS_VK_DOWN ||
theChar == NS_VK_HOME ||
theChar == NS_VK_END) {
// The navigation keys were pressed. User is moving around within
// the menus.
mMenuParent->KeyboardNavigation(theChar, handled);
}

View File

@@ -1179,13 +1179,19 @@ nsMenuPopupFrame::KeyboardNavigation(PRUint32 aDirection, PRBool& aHandledFlag)
return NS_OK; // The child menu took it for us.
// For the vertical direction, we can move up or down.
if (aDirection == NS_VK_UP || aDirection == NS_VK_DOWN) {
if (aDirection == NS_VK_UP || aDirection == NS_VK_DOWN ||
aDirection == NS_VK_HOME || aDirection == NS_VK_END) {
nsIMenuFrame* nextItem;
if (aDirection == NS_VK_DOWN)
if (aDirection == NS_VK_UP)
GetPreviousMenuItem(mCurrentMenu, &nextItem);
else if (aDirection == NS_VK_DOWN)
GetNextMenuItem(mCurrentMenu, &nextItem);
else GetPreviousMenuItem(mCurrentMenu, &nextItem);
else if (aDirection == NS_VK_HOME)
GetNextMenuItem(nsnull, &nextItem);
else
GetPreviousMenuItem(mCurrentMenu, &nextItem);
SetCurrentMenuItem(nextItem);