B2G/gecko/testing/peptest/peptest/extension/resource/mozmill/stdlib/EventUtils.js
/**
 * Parse the key modifier flags from aEvent. Used to share code between
 * synthesizeMouse and synthesizeKey.
 */
Parse the key modifier flags from aEvent. Used to share code between
synthesizeMouse and synthesizeKey.
Parse the key modifier flags from aEvent . Used to share code between synthesizeMouse and synthesizeKey .
function _parseModifiers(aEvent)
{
  var hwindow = Components.classes["@mozilla.org/appshell/appShellService;1"]
                          .getService(Components.interfaces.nsIAppShellService)
                          .hiddenDOMWindow;
  const masks = Components.interfaces.nsIDOMNSEvent;
  var mval = 0;
  if (aEvent.shiftKey)
    mval |= masks.SHIFT_MASK;
  if (aEvent.ctrlKey)
    mval |= masks.CONTROL_MASK;
  if (aEvent.altKey)
    mval |= masks.ALT_MASK;
  if (aEvent.metaKey)
    mval |= masks.META_MASK;
  if (aEvent.accelKey)
    mval |= (hwindow.navigator.platform.indexOf("Mac") >= 0) ? masks.META_MASK :
                                                               masks.CONTROL_MASK;
  return mval;
}
function _parseModifiers ( aEvent ) { var hwindow = Components . classes [ "@mozilla.org/appshell/appShellService;1" ] . getService ( Components . interfaces . nsIAppShellService ) . hiddenDOMWindow ; const masks = Components . interfaces . nsIDOMNSEvent ; var mval = 0 ; if ( aEvent . shiftKey ) mval |= masks . SHIFT_MASK ; if ( aEvent . ctrlKey ) mval |= masks . CONTROL_MASK ; if ( aEvent . altKey ) mval |= masks . ALT_MASK ; if ( aEvent . metaKey ) mval |= masks . META_MASK ; if ( aEvent . accelKey ) mval |= ( hwindow . navigator . platform . indexOf ( "Mac" ) >= 0 ) ? masks . META_MASK : masks . CONTROL_MASK ; return mval ; }
Parse the key modifier flags from aEvent.
Parse the key modifier flags from aEvent .