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

This commit is contained in:
dr%netscape.com 2001-03-24 00:12:47 +00:00
Родитель d7295155e5
Коммит c490b11e1e
2 изменённых файлов: 13 добавлений и 5 удалений

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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);