B2G/gecko/toolkit/components/satchel/test/satchel_common.js
// This basically sends an untargeted key event, to whatever's focused.
This basically sends an untargeted key event, to whatever's focused.
This basically sends an untargeted key event to whatever ' s focused .
function doKey(aKey, modifier) {
    var keyName = "DOM_VK_" + aKey.toUpperCase();
    var key = SpecialPowers.Ci.nsIDOMKeyEvent[keyName];
    if (!modifier)
        modifier = null;
    var wutils = SpecialPowers.getDOMWindowUtils(window);
    wutils.sendKeyEvent("keydown",  key, 0, modifier);
    wutils.sendKeyEvent("keypress", key, 0, modifier);
    wutils.sendKeyEvent("keyup",    key, 0, modifier);
}
function doKey ( aKey , modifier ) { var keyName = "DOM_VK_" + aKey . toUpperCase ( ) ; var key = SpecialPowers . Ci . nsIDOMKeyEvent [ keyName ] ; if ( ! modifier ) modifier = null ; var wutils = SpecialPowers . getDOMWindowUtils ( window ) ; wutils . sendKeyEvent ( "keydown" , key , 0 , modifier ) ; wutils . sendKeyEvent ( "keypress" , key , 0 , modifier ) ; wutils . sendKeyEvent ( "keyup" , key , 0 , modifier ) ; }
This basically sends an untargeted key event, to whatever's focused.
This basically sends an untargeted key event to whatever ' s focused .
// undefined --> null // Window utils for sending fake sey events.