mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Fix arrow keys in editors. Bug 330133, r=timeless, sr=neil
This commit is contained in:
parent
0412146c05
commit
b8488d8978
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user