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
Родитель a91fad2dbb
Коммит 6ab5787b83
2 изменённых файлов: 4 добавлений и 2 удалений

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

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

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

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