use native event routing for synthesized key events. b=432405 r/sr=roc a=dsicore

This commit is contained in:
joshmoz@gmail.com 2008-05-06 14:00:59 -07:00
parent dd184ae583
commit bb23f9115a
2 changed files with 4 additions and 2 deletions

View File

@ -1305,8 +1305,8 @@ void nsChildView::SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout,
PRInt32 currentLayout = gOverrideKeyboardLayout;
gOverrideKeyboardLayout = aNativeKeyboardLayout;
ChildView* view = static_cast<ChildView*>(mView);
[view keyDown:downEvent];
[view keyUp:upEvent];
[NSApp sendEvent:downEvent];
[NSApp sendEvent:upEvent];
// processKeyDownEvent and keyUp block exceptions so we're sure to
// reach here to restore gOverrideKeyboardLayout
gOverrideKeyboardLayout = currentLayout;

View File

@ -39,6 +39,8 @@ function synthesizeNativeKey(aLayout, aKeyCode, aModifiers, aSystemChars,
if (!aWindow)
aWindow = window;
document.getElementById("button").focus();
var utils = aWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);