Fix arrow keys in editors. Bug 330133, r=timeless, sr=neil
git-svn-id: svn://10.0.0.236/trunk@192314 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -197,6 +197,9 @@ nsXBLWindowKeyHandler::WalkHandlers(nsIDOMEvent* aKeyEvent, nsIAtom* aEventType)
|
||||
nsINativeKeyBindings *nativeBindings;
|
||||
if (isEditor && (nativeBindings = GetEditorKeyBindings())) {
|
||||
nsNativeKeyEvent nativeEvent;
|
||||
// Some key events have no useful charCode
|
||||
nativeEvent.charCode = 0;
|
||||
keyEvent->GetKeyCode(&nativeEvent.keyCode);
|
||||
keyEvent->GetAltKey(&nativeEvent.altKey);
|
||||
keyEvent->GetCtrlKey(&nativeEvent.ctrlKey);
|
||||
keyEvent->GetShiftKey(&nativeEvent.shiftKey);
|
||||
@@ -218,15 +221,12 @@ nsXBLWindowKeyHandler::WalkHandlers(nsIDOMEvent* aKeyEvent, nsIAtom* aEventType)
|
||||
keyEvent->GetCharCode(&nativeEvent.charCode);
|
||||
handled = sNativeEditorBindings->KeyPress(nativeEvent,
|
||||
DoCommandCallback, controllers);
|
||||
} else if (aEventType == nsXBLAtoms::keyup) {
|
||||
handled = sNativeEditorBindings->KeyUp(nativeEvent,
|
||||
DoCommandCallback, controllers);
|
||||
} else {
|
||||
keyEvent->GetKeyCode(&nativeEvent.keyCode);
|
||||
if (aEventType == nsXBLAtoms::keyup) {
|
||||
handled = sNativeEditorBindings->KeyUp(nativeEvent,
|
||||
handled = sNativeEditorBindings->KeyDown(nativeEvent,
|
||||
DoCommandCallback, controllers);
|
||||
} else {
|
||||
handled = sNativeEditorBindings->KeyDown(nativeEvent,
|
||||
DoCommandCallback, controllers);
|
||||
}
|
||||
}
|
||||
|
||||
if (handled)
|
||||
|
||||
Reference in New Issue
Block a user