Bug 57192. Alt+Down for combo boxes in HTML. r=rods, sr=waterson

This commit is contained in:
aaronl%netscape.com 2001-10-16 23:00:12 +00:00
parent 96a6390760
commit 1324edad85
2 changed files with 22 additions and 0 deletions

View File

@ -2187,6 +2187,17 @@ nsComboboxControlFrame::HandleEvent(nsIPresContext* aPresContext,
return NS_OK;
}
// Toggle list open and close on Alt-Down or Alt-Up
if (aEvent->message == NS_KEY_PRESS) {
nsKeyEvent* keyEvent = (nsKeyEvent*)aEvent;
nsInputEvent *inputEvent = (nsInputEvent*)aEvent;
if (!inputEvent->isShift && !inputEvent->isControl && !inputEvent->isMeta &&
inputEvent->isAlt && (keyEvent->keyCode == NS_VK_DOWN || (mDroppedDown && keyEvent->keyCode == NS_VK_UP)))
ToggleList(aPresContext);
}
// If we have style that affects how we are selected, feed event down to
// nsFrame::HandleEvent so that selection takes place when appropriate.
const nsStyleUserInterface* uiStyle;

View File

@ -2187,6 +2187,17 @@ nsComboboxControlFrame::HandleEvent(nsIPresContext* aPresContext,
return NS_OK;
}
// Toggle list open and close on Alt-Down or Alt-Up
if (aEvent->message == NS_KEY_PRESS) {
nsKeyEvent* keyEvent = (nsKeyEvent*)aEvent;
nsInputEvent *inputEvent = (nsInputEvent*)aEvent;
if (!inputEvent->isShift && !inputEvent->isControl && !inputEvent->isMeta &&
inputEvent->isAlt && (keyEvent->keyCode == NS_VK_DOWN || (mDroppedDown && keyEvent->keyCode == NS_VK_UP)))
ToggleList(aPresContext);
}
// If we have style that affects how we are selected, feed event down to
// nsFrame::HandleEvent so that selection takes place when appropriate.
const nsStyleUserInterface* uiStyle;