Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  test_keycodes.xhtml   Sprache: unbekannt

 
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
                 type="text/css"?>
<window title="Key event tests"
  onload="runTest()"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
  <script src="chrome://mochikit/content/tests/SimpleTest/NativeKeyCodes.js" />
  <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />

<commandset>
  <command id="expectedCommand" oncommand="this.activeCount++" disabled="true"/>
  <command id="unexpectedCommand" oncommand="this.activeCount++" disabled="true"/>
  <command id="expectedReservedCommand" oncommand="this.activeCount++" reserved="true" disabled="true"/>
</commandset>
<keyset>
  <key id="unshiftedKey" key=";" modifiers="accel" command="unexpectedCommand"/>
  <key id="shiftedKey" key=":" modifiers="accel" command="unexpectedCommand"/>
  <key id="commandOptionF" key='f' modifiers="accel,alt" command="unexpectedCommand"/>
  <key id="question" key='?' modifiers="accel" command="unexpectedCommand"/>
  <key id="unshiftedX" key="x" modifiers="accel" command="unexpectedCommand"/>
  <key id="shiftedX" key="X" modifiers="accel,shift" command="unexpectedCommand"/>
  <key id="ctrlAltA" key="a" modifiers="accel,alt" command="unexpectedCommand"/>
  <key id="ctrlAltShiftA" key="A" modifiers="accel,alt,shift" command="unexpectedCommand"/>
  <key id="unshiftedPlus" key="+" modifiers="accel" command="unexpectedCommand"/>
  <key id="reservedUnshiftedKey" key="'" modifiers="accel" command="unexpectedCommand"/>
  <key id="reservedShiftedKey" key='"' modifiers="accel" command="unexpectedCommand"/>
</keyset>

<browser id="browser" type="content" src="data:text/html;charset=utf-8,<button id='content_button'>button</button>" width="200" height="32"/>

<body  xmlns="http://www.w3.org/1999/xhtml">
<p id="display">
  <!-- for some reason, if we don't have 'accesskey' here, adding it dynamically later
       doesn't work! -->
  <button id="button" accesskey="z">Hello</button>
  <input type="text" id="textbox" value=""/>
</p>
<div id="content" style="display: none">
  
</div>
<pre id="test">
</pre>
</body>

<script class="testbody" type="application/javascript">
<![CDATA[
const IS_MAC = navigator.platform.indexOf("Mac") == 0;
const IS_WIN = navigator.platform.indexOf("Win") == 0;
const OS_VERSION =
  IS_WIN  ? parseFloat(Services.sysinfo.getProperty("version")) : 0;
const WIN8 = 6.2; // Can remove once bug 1594270 is closed

function isModifierKeyEvent(aEvent)
{
  switch (aEvent.key) {
    case "Alt":
    case "AltGraph":
    case "CapsLock":
    case "Control":
    case "Fn":
    case "FnLock":
    case "Hyper":
    case "Meta":
    case "NumLock":
    case "ScrollLock":
    case "Shift":
    case "Super":
    case "Symbol":
    case "SymbolLock":
      return true;
    default:
      return false;
  }
}

/**
 * Firefox infobar UI can have access keys which conflict with this test. Really
 * stupid workaround until we can move this test into its own chrome window.
 */
function clearInfobars()
{
  var browser = window.top.docShell.chromeEventHandler;
  var chromeWin = browser.ownerGlobal;
  var nb = chromeWin.gBrowser.getNotificationBox(browser);
  for (let n of nb.allNotifications) {
    nb.removeNotification(n, true);
  }
}

function eventToString(aEvent)
{
  var name = aEvent.layout.name + " keyCode=" +
    aEvent.keyCode + " (0x" + aEvent.keyCode.toString(16).toUpperCase() +
      ") chars='" + aEvent.chars + "'";
  if (typeof aEvent.unmodifiedChars === "string") {
    name += " unmodifiedChars='" + aEvent.unmodifiedChars + "'";
  }
  if (aEvent.modifiers.capsLockKey) {
    name += " [CapsLock]";
  }
  if (aEvent.modifiers.shiftKey) {
    name += " [Shift]";
  }
  if (aEvent.modifiers.shiftRightKey) {
    name += " [Right Shift]";
  }
  if (aEvent.modifiers.ctrlKey) {
    name += " [Ctrl]";
  }
  if (aEvent.modifiers.ctrlRightKey) {
    name += " [Right Ctrl]";
  }
  if (aEvent.modifiers.altKey) {
    name += " [Alt]";
  }
  if (aEvent.modifiers.altGrKey) {
    name += " [AltGr]";
  }
  if (aEvent.modifiers.altRightKey) {
    name += " [Right Alt]";
  }
  if (aEvent.modifiers.metaKey) {
    name += ` [${IS_MAC ? "Command" : "Win"}]`;
  }
  if (aEvent.modifiers.metaRightKey) {
    name += ` [Right ${IS_MAC ? "Command" : "Win"}]`;
  }

  return name;  
}

function getPhase(aDOMEvent)
{
  switch (aDOMEvent.eventPhase) {
    case aDOMEvent.None:
      return "none";
    case aDOMEvent.CAPTURING_PHASE:
      return "capture";
    case aDOMEvent.AT_TARGET:
      return "target";
    case aDOMEvent.BUBBLING_PHASE:
      return "bubble";
    default:
      return "";
   }
}

function eventTargetToString(aEventTarget)
{
  if (aEventTarget.navigator) {
    return "window";
  }
  switch (aEventTarget.nodeType) {
    case Node.ELEMENT_NODE:
      return "element (" + aEventTarget.tagName + ")";
    case Node.DOCUMENT_NODE:
      return "document";
    default:
      return "";
  }
}

function synthesizeKey(aEvent, aFocusElementId, aCallback)
{
  if (aFocusElementId.startsWith("content_")) {
    var browser = document.getElementById("browser");
    browser.contentDocument.getElementById(aFocusElementId).focus();
  } else {
    document.getElementById(aFocusElementId).focus();
  }

  return synthesizeNativeKey(aEvent.layout, aEvent.keyCode,
                             aEvent.modifiers,
                             aEvent.chars, aEvent.unmodifiedChars,
                             aCallback);
}

// Test the charcodes and modifiers being delivered to keypress handlers and
// also keydown/keyup events too.
function* runKeyEventTests()
{
  var currentTestName;
  var eventList, keyDownFlags, keyUpFlags, testingEvent, expectedDOMKeyCode;
  const kShiftFlag    = 0x1;
  const kCtrlFlag     = 0x2;
  const kAltFlag      = 0x4;
  const kMetaFlag     = 0x8;
  const kNumLockFlag  = 0x10;
  const kCapsLockFlag = 0x20;
  const kAltGraphFlag = 0x40;

  function onKeyEvent(e)
  {
    /* eslint-disable-next-line no-shadow */
    function removeFlag(e, aFlag)
    {
      if (e.type == "keydown") {
        let oldValue = keyDownFlags;
        keyDownFlags &= ~aFlag;
        return oldValue != keyDownFlags;
      } else if (e.type == "keyup") {
        let oldValue = keyUpFlags;
        keyUpFlags &= ~aFlag;
        return oldValue != keyUpFlags;
      }
      return false;
    }

    /* eslint-disable-next-line no-shadow, complexity */
    function isStateChangingModifierKeyEvent(e)
    {
      var flags = 0;
      if (e.type == "keydown") {
        flags = keyDownFlags ^ keyUpFlags;
      } else if (e.type == "keyup") {
        flags = keyUpFlags;
      }
      switch (e.key) {
        case "Shift":
          is(e.ctrlKey, (flags & kCtrlFlag) != 0,
             currentTestName + ", Ctrl of Shift " + e.type + " event mismatch");
          is(e.metaKey, (flags & kMetaFlag) != 0,
             currentTestName + ", Command of Shift " + e.type + " event mismatch");
          is(e.altKey, (flags & kAltFlag) != 0,
             currentTestName + ", Alt of Shift " + e.type + " event mismatch");
          is(e.shiftKey, e.type == "keydown",
             currentTestName + ", Shift of Shift " + e.type + " event mismatch");
          // AltGr on Windows is always pressed after and released before Shift key operation.
          is(e.getModifierState("AltGraph"), (IS_MAC && e.altKey),
             currentTestName + ", AltGraph of Shift " + e.type + " event mismatch");
          return (testingEvent.modifiers.shiftKey || testingEvent.modifiers.shiftRightKey) &&
                 removeFlag(e, kShiftFlag) && expectedDOMKeyCode != e.keyCode;
        case "Control":
          is(e.ctrlKey, e.type == "keydown",
             currentTestName + ", Ctrl of Ctrl " + e.type + " event mismatch");
          is(e.metaKey, (flags & kMetaFlag) != 0,
             currentTestName + ", Command of Ctrl " + e.type + " event mismatch");
          // When AltGr key is released on Windows, ControlLeft keyup event
          // is followed by AltRight keyup event.  However, altKey should be
          // false in such case.
          is(e.altKey, (flags & kAltFlag) != 0 && !(IS_WIN && !!testingEvent.modifiers.altGrKey),
             currentTestName + ", Alt of Ctrl " + e.type + " event mismatch");
          is(e.shiftKey, (flags & kShiftFlag) != 0,
             currentTestName + ", Shift of Ctrl " + e.type + " event mismatch");
          is(e.getModifierState("AltGraph"),
             (IS_WIN && !!testingEvent.modifiers.altGrKey && e.type == "keyup") || (IS_MAC && e.altKey),
             currentTestName + ", AltGraph of Ctrl " + e.type + " event mismatch");
          return (testingEvent.modifiers.ctrlKey || testingEvent.modifiers.ctrlRightKey ||
                  (IS_WIN && !!testingEvent.modifiers.altGrKey)) &&
                 removeFlag(e, kCtrlFlag) && expectedDOMKeyCode != e.keyCode;
        case "Alt":
          is(e.ctrlKey, (flags & kCtrlFlag) != 0 && !(IS_WIN && !!testingEvent.modifiers.altGrKey),
             currentTestName + ", Ctrl of Alt " + e.type + " event mismatch");
          is(e.metaKey, (flags & kMetaFlag) != 0,
             currentTestName + ", Command of Alt " + e.type + " event mismatch");
          is(e.altKey, e.type == "keydown" && !(IS_WIN && !!testingEvent.modifiers.altGrKey),
             currentTestName + ", Alt of Alt " + e.type + " event mismatch");
          is(e.shiftKey, (flags & kShiftFlag) != 0,
             currentTestName + ", Shift of Alt " + e.type + " event mismatch");
          is(e.getModifierState("AltGraph"),
             e.type == "keydown" && ((IS_WIN && !!testingEvent.modifiers.altGrKey) || (IS_MAC && e.altKey)),
             currentTestName + ", AltGraph of Alt " + e.type + " event mismatch");
          return (testingEvent.modifiers.altKey || testingEvent.modifiers.altRightKey ||
                  (IS_WIN && !!testingEvent.modifiers.altGrKey)) &&
                 removeFlag(e, kAltFlag) && expectedDOMKeyCode != e.keyCode;
        case "AltGraph":
          // On Windows, AltGraph events are fired only when AltRight key is
          // pressed when active keyboard layout maps AltGraph to AltRight.
          // Note that AltGraph is represented with pressing both Control key
          // and Alt key.  Therefore, when AltGraph keyboard event is fired,
          // both ctrlKey and altKey are always false on Windows.
          is(e.ctrlKey, (flags & kCtrlFlag) != 0 && !IS_WIN,
             currentTestName + ", Ctrl of AltGraph " + e.type + " event mismatch");
          is(e.metaKey, (flags & kMetaFlag) != 0,
             currentTestName + ", Command of AltGraph " + e.type + " event mismatch");
          is(e.altKey, (flags & kAltFlag) != 0 && !IS_WIN,
             currentTestName + ", Alt of AltGraph " + e.type + " event mismatch");
          is(e.shiftKey, (flags & kShiftFlag) != 0,
             currentTestName + ", Shift of Ctrl " + e.type + " event mismatch");
          is(e.getModifierState("AltGraph"), e.type === "keydown",
             currentTestName + ", AltGraph of AltGraph " + e.type + " event mismatch");
          return IS_WIN && testingEvent.modifiers.altGrKey &&
                 removeFlag(e, kAltGraphFlag) && expectedDOMKeyCode != e.keyCode;
        case "Meta":
          is(e.ctrlKey, (flags & kCtrlFlag) != 0,
             currentTestName + ", Ctrl of Command " + e.type + " event mismatch");
          is(e.metaKey, e.type == "keydown",
             currentTestName + ", Command of Command " + e.type + " event mismatch");
          is(e.altKey, (flags & kAltFlag) != 0,
             currentTestName + ", Alt of Command " + e.type + " event mismatch");
          is(e.shiftKey, (flags & kShiftFlag) != 0,
             currentTestName + ", Shift of Command " + e.type + " event mismatch");
          is(e.getModifierState("AltGraph"),
             (IS_WIN && (flags & kAltGraphFlag) != 0) || (IS_MAC && e.altKey),
             currentTestName + ", AltGraph of Meta " + e.type + " event mismatch");
          return (testingEvent.modifiers.metaKey || testingEvent.modifiers.metaRightKey) &&
                 removeFlag(e, kMetaFlag) && expectedDOMKeyCode != e.keyCode;
        case "NumLock":
          is(e.ctrlKey, (flags & kCtrlFlag) != 0,
             currentTestName + ", Ctrl of NumLock " + e.type + " event mismatch");
          is(e.metaKey, (flags & kMetaFlag) != 0,
             currentTestName + ", Command of NumLock " + e.type + " event mismatch");
          is(e.altKey, (flags & kAltFlag) != 0,
             currentTestName + ", Alt of NumLock " + e.type + " event mismatch");
          is(e.shiftKey, (flags & kShiftFlag) != 0,
             currentTestName + ", Shift of NumLock " + e.type + " event mismatch");
          is(e.getModifierState("AltGraph"), false,
             currentTestName + ", AltGraph of NumLock " + e.type + " event mismatch");
          // AltGr on Windows is always pressed after and released before NumLock key operation.
          return (testingEvent.modifiers.numLockKey || testingEvent.modifiers.numericKeyPadKey) &&
                 removeFlag(e, kNumLockFlag) && expectedDOMKeyCode != e.keyCode;
        case "CapsLock":
          is(e.ctrlKey, (flags & kCtrlFlag) != 0,
             currentTestName + ", Ctrl of CapsLock " + e.type + " event mismatch");
          is(e.metaKey, (flags & kMetaFlag) != 0,
             currentTestName + ", Command of CapsLock " + e.type + " event mismatch");
          is(e.altKey, (flags & kAltFlag) != 0,
             currentTestName + ", Alt of CapsLock " + e.type + " event mismatch");
          is(e.shiftKey, (flags & kShiftFlag) != 0,
             currentTestName + ", Shift of CapsLock " + e.type + " event mismatch");
          // AltGr on Windows is always pressed after and released before CapsLock key operation.
          is(e.getModifierState("AltGraph"), false,
             currentTestName + ", AltGraph of CapsLock " + e.type + " event mismatch");
          return testingEvent.modifiers.capsLockKey &&
                 removeFlag(e, kCapsLockFlag) && expectedDOMKeyCode != e.keyCode;
      }
      return false;
    }

    // Ignore the state changing key events which is fired by the testing event.
    if (!isStateChangingModifierKeyEvent(e))
      eventList.push(e);
  }

  function consumer(aEvent)
  {
    aEvent.preventDefault();
  }

  const SHOULD_DELIVER_KEYDOWN          = 0x1;
  const SHOULD_DELIVER_KEYPRESS         = 0x2;
  const SHOULD_DELIVER_KEYUP            = 0x4;
  const SHOULD_DELIVER_ALL              = SHOULD_DELIVER_KEYDOWN |
                                          SHOULD_DELIVER_KEYPRESS |
                                          SHOULD_DELIVER_KEYUP;
  const SHOULD_DELIVER_KEYDOWN_KEYUP    = SHOULD_DELIVER_KEYDOWN |
                                          SHOULD_DELIVER_KEYUP;
  const SHOULD_DELIVER_KEYDOWN_KEYPRESS = SHOULD_DELIVER_KEYDOWN |
                                          SHOULD_DELIVER_KEYPRESS;

  // The first parameter is the complete input event. The second parameter is
  // what to test against. The third parameter is which key events should be
  // delived for the event.
  // @param aExpectedKeyValues     Can be string or array of string.
  //                               If all keyboard events have same key value,
  //                               specify it as string.  Otherwise, specify
  //                               each key value in array.
  function testKey(aEvent, aExpectedKeyValues, aExpectedCodeValue,
                   aExpectedGeckoKeyCode, aExpectGeckoChar,
                   aShouldDelivedEvent, aExpectLocation)
  {
    ok(aExpectedGeckoKeyCode != undefined, "keycode is undefined");
    eventList = [];

    // The modifier key events which are fired for state changing are har to
    // test. We should ignore them for now.
    keyDownFlags = keyUpFlags = 0;
    if (!IS_MAC) {
      // On Mac, nsChildView doesn't generate modifier keydown/keyup events for
      // state changing for synthesizeNativeKeyEvent.
      if (aEvent.modifiers.shiftKey || aEvent.modifiers.shiftRightKey) {
        keyDownFlags |= kShiftFlag;
      }
      if (aEvent.modifiers.ctrlKey || aEvent.modifiers.ctrlRightKey ||
          (IS_WIN && aEvent.modifiers.altGrKey)) {
        keyDownFlags |= kCtrlFlag;
      }
      if (aEvent.modifiers.altKey || aEvent.modifiers.altRightKey) {
        keyDownFlags |= kAltFlag;
      }
      if (aEvent.modifiers.altGrKey) {
        keyDownFlags |= kAltGraphFlag;
      }
      if (aEvent.modifiers.metaKey || aEvent.modifiers.metaRightKey) {
        keyDownFlags |= kMetaFlag;
      }
      if (aEvent.modifiers.numLockKey || aEvent.modifiers.numericKeyPadKey) {
        keyDownFlags |= kNumLockFlag;
      }
      if (aEvent.modifiers.capsLockKey) {
        keyDownFlags |= kCapsLockFlag;
      }
      keyUpFlags = keyDownFlags;
    }

    testingEvent = aEvent;
    expectedDOMKeyCode = aExpectedGeckoKeyCode;

    currentTestName = eventToString(aEvent);
    ok(true, "Starting: " + currentTestName);

    // eslint-disable-next-line complexity
    return synthesizeKey(aEvent, "button", function() {

      var expectEventTypeList = [];
      if (aShouldDelivedEvent & SHOULD_DELIVER_KEYDOWN)
        expectEventTypeList.push("keydown");
      if (aShouldDelivedEvent & SHOULD_DELIVER_KEYPRESS) {
        expectEventTypeList.push("keypress");
        for (let i = 1; i < aExpectGeckoChar.length; i++) {
          expectEventTypeList.push("keypress");
        }
      }
      if (aShouldDelivedEvent & SHOULD_DELIVER_KEYUP)
        expectEventTypeList.push("keyup");
      is(eventList.length, expectEventTypeList.length,
         currentTestName + ", wrong number of key events");

      var longerLength = Math.max(eventList.length, expectEventTypeList.length);
      var keypressCount = 0;
      for (let i = 0; i < longerLength; i++) {
        var firedEventType = i < eventList.length ? eventList[i].type : "";
        var expectEventType = i < expectEventTypeList.length ? expectEventTypeList[i] : "";
        if (firedEventType != "") {
          is(firedEventType, expectEventType,
             currentTestName + ", " + expectEventType + " should be fired");
        } else {
          is(firedEventType, expectEventType,
             currentTestName + ", a needed event is not fired");
        }

        if (firedEventType != "") {
          var expectedKeyValue =
            // eslint-disable-next-line no-nested-ternary
            typeof aExpectedKeyValues === "string" ? aExpectedKeyValues :
                     i < aExpectedKeyValues.length ? aExpectedKeyValues[i] :
                                                     undefined;

          var e = eventList[i];
          switch (e.key) {
            case "Shift":
            case "Control":
            case "Alt":
            case "AltGraph":
            case "Meta":
            case "CapsLock":
            case "NumLock":
              // XXX To check modifier state of modifiers, we need to check
              //     e.type since modifier key may change modifier state.
              //     However, doing it makes the following check more
              //     complicated.  So, we ignore the modifier state of
              //     modifier keydown/keyup events for now.
              break;
            default:
              is(e.shiftKey, !!(aEvent.modifiers.shiftKey || aEvent.modifiers.shiftRightKey),
                 currentTestName + ", Shift of " + e.type + " of " + e.code + " mismatch");
              is(e.metaKey, !!(aEvent.modifiers.metaKey || aEvent.modifiers.metaRightKey),
                 currentTestName + ", Meta of " + e.type + " of " + e.code + " mismatch");
              var isControlPressed = !!(aEvent.modifiers.ctrlKey || aEvent.modifiers.ctrlRightKey);
              var isAltPressed = !!(aEvent.modifiers.altKey || aEvent.modifiers.altRightKey);
              var isAltGraphExpected =
                !!aEvent.modifiers.altGrKey ||
                (IS_WIN && aEvent.layout.hasAltGrOnWin &&
                 isControlPressed && isAltPressed &&
                 (aEvent.isInputtingCharacters || expectedKeyValue == "Dead")) ||
                (IS_MAC && isAltPressed);
              var isControlExpected = !(IS_WIN && isAltGraphExpected) && isControlPressed;
              var isAltExpected = !(IS_WIN && isAltGraphExpected) && isAltPressed;
              if (e.type == "keypress" && aEvent.isInputtingCharacters) {
                isControlExpected = false;
                isAltExpected = false;
              }
              is(e.ctrlKey, isControlExpected,
                 currentTestName + ", Ctrl of " + e.type + " of " + e.code + " mismatch");
              is(e.altKey, isAltExpected,
                 currentTestName + ", Alt of " + e.type + " of " + e.code + " mismatch");
              is(e.getModifierState("AltGraph"), isAltGraphExpected,
                 currentTestName + ", AltGraph of " + e.type + " of " + e.code + " mismatch");
              break;
          }

          is(e.key, expectedKeyValue, currentTestName + ", wrong key value");
          is(e.code, aExpectedCodeValue, currentTestName + ", wrong code value");

          if (aExpectGeckoChar.length && e.type == "keypress") {
            is(e.charCode, aExpectGeckoChar.charCodeAt(keypressCount++),
               currentTestName + ", charcode");
            if (aExpectedGeckoKeyCode >= 0) {
              if (aExpectGeckoChar) {
                is(e.keyCode, 0,
                   currentTestName + ", wrong keycode");
              } else {
                is(e.keyCode, aExpectedGeckoKeyCode,
                   currentTestName + ", wrong keycode");
              }
            }
          } else {
            is(e.charCode, 0,
               currentTestName + ", no charcode");
            if (aExpectedGeckoKeyCode >= 0) {
              is(e.keyCode, aExpectedGeckoKeyCode,
                 currentTestName + ", wrong keycode");
            }
          }
          is(e.location, aExpectLocation,
             currentTestName + ", wrong location");
        }
      }

      continueTest();
    });
  }

  // These tests have to be per-plaform.
  document.addEventListener("keydown",  onKeyEvent);
  document.addEventListener("keypress", onKeyEvent);
  document.addEventListener("keyup",    onKeyEvent);
  // Prevent almost all shortcut key handlers.
  SpecialPowers.wrap(document).addEventListener("keypress", consumer, { capture: true, mozSystemGroup: true });

  function cleanup()
  {
    document.removeEventListener("keydown",  onKeyEvent);
    document.removeEventListener("keypress", onKeyEvent);
    document.removeEventListener("keyup",    onKeyEvent);
    SpecialPowers.wrap(document).removeEventListener("keypress", consumer, { capture: true, mozSystemGroup: true });
  }

  function* testKeysOnMac()
  {
    // On Mac, you can produce event records for any desired keyboard input
    // by running with NSPR_LOG_MODULES=TextInputHandlerWidgets:5 and typing
    // into the browser.  We will dump the key event fields to the console
    // (Find TextInputHandler::HandleKeyDownEvent or
    // TextInputHandler::HandleKeyUpEvent in the log). Use the International system
    // preferences widget to enable other keyboard layouts and select them from the
    // input menu to see what keyboard events they generate.
    // Note that it's possible to send bogus key events here, e.g.
    // {keyCode:0, chars:"z", unmodifiedChars:"P"} --- sendNativeKeyEvent
    // makes no attempt to verify that the keyCode matches the characters. So only
    // test key event records that you saw Cocoa send.

    // Command keys
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
                   modifiers:{metaKey:1}, chars:"a", unmodifiedChars:"a"},
                  "a", "KeyA", KeyboardEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    // Shift-cmd gives us the shifted character
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
                   modifiers:{metaKey:1, shiftKey:1}, chars:"a", unmodifiedChars:"A"},
                  "a", "KeyA", KeyboardEvent.DOM_VK_A, "A", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    // Ctrl-cmd gives us the unshifted character
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
                   modifiers:{metaKey:1, ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"},
                  "a", "KeyA", KeyboardEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    // Alt-cmd gives us the shifted character
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
                   modifiers:{metaKey:1, altKey:1}, chars:"\u00e5", unmodifiedChars:"a"},
                  "\u00e5", "KeyA", KeyboardEvent.DOM_VK_A, "\u00e5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
                   modifiers:{metaKey:1, altKey:1, shiftKey:1}, chars:"\u00c5", unmodifiedChars:"a"},
                  "\u00c5", "KeyA", KeyboardEvent.DOM_VK_A, "\u00c5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);

    // Greek ctrl keys produce Latin charcodes
    yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
                   modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"},
                  "\u03b1", "KeyA", KeyboardEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
                   modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001", unmodifiedChars:"\u0391"},
                  "\u0391", "KeyA", KeyboardEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);

    // Greek command keys
    yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
                   modifiers:{metaKey:1}, chars:"a", unmodifiedChars:"\u03b1"},
                  "a", "KeyA", KeyboardEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    // Shift-cmd gives us the shifted character
    yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
                   modifiers:{metaKey:1, shiftKey:1}, chars:"a", unmodifiedChars:"\u0391"},
                  "a", "KeyA", KeyboardEvent.DOM_VK_A, "A", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);

    // Ctrl-cmd gives us the unshifted character
    yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
                   modifiers:{metaKey:1, ctrlKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"},
                  "\u03b1", "KeyA", KeyboardEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    // Alt-cmd gives us the shifted character
    yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
                   modifiers:{metaKey:1, altKey:1}, chars:"\u00a8", unmodifiedChars:"\u03b1"},
                  "\u00a8", "KeyA", KeyboardEvent.DOM_VK_A, "\u00a8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
                   modifiers:{metaKey:1, altKey:1, shiftKey:1}, chars:"\u00b9", unmodifiedChars:"\u0391"},
                  "\u00b9", "KeyA", KeyboardEvent.DOM_VK_A, "\u00b9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);

    // German
    yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_A,
                   modifiers: {}, chars:"a", unmodifiedChars:"a"},
                  "a", "KeyA", KeyboardEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_LeftBracket,
                   modifiers: {}, chars:"\u00fc", unmodifiedChars:"\u00fc"},
                  "\u00fc", "BracketLeft", KeyboardEvent.DOM_VK_OPEN_BRACKET, "\u00fc", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus,
                   modifiers: {}, chars:"\u00df", unmodifiedChars:"\u00df"},
                  "\u00df", "Minus", KeyboardEvent.DOM_VK_QUESTION_MARK, "\u00df", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus,
                   modifiers:{shiftKey:1}, chars:"?", unmodifiedChars:"?"},
                  "?", "Minus", KeyboardEvent.DOM_VK_QUESTION_MARK, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    // Note that Shift+SS is '?' but Cmd+Shift+SS is '/' on German layout.
    // Therefore, when Cmd key is pressed, the SS key's keycode is changed.
    yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus,
                   modifiers:{metaKey:1}, chars:"\u00df", unmodifiedChars:"\u00df"},
                  "\u00df", "Minus", KeyboardEvent.DOM_VK_SLASH, "\u00df", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus,
                   modifiers:{metaKey:1, shiftKey:1}, chars:"/", unmodifiedChars:"?"},
                  "/", "Minus", KeyboardEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);

    // Caps Lock key event
    // XXX keyup event of Caps Lock key is not fired.
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_CapsLock,
                   modifiers:{capsLockKey:1}, chars:"", unmodifiedChars:""},
                  "CapsLock", "CapsLock", KeyboardEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_CapsLock,
                   modifiers:{capsLockKey:0}, chars:"", unmodifiedChars:""},
                  "CapsLock", "CapsLock", KeyboardEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);

    // Shift/RightShift key event
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Shift,
                   modifiers:{shiftKey:1}, chars:"", unmodifiedChars:""},
                  "Shift", "ShiftLeft", KeyboardEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Shift,
                   modifiers:{shiftKey:0}, chars:"", unmodifiedChars:""},
                  "Shift", "ShiftLeft", KeyboardEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightShift,
                   modifiers:{shiftRightKey:1}, chars:"", unmodifiedChars:""},
                  "Shift", "ShiftRight", KeyboardEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightShift,
                   modifiers:{shiftRightKey:0}, chars:"", unmodifiedChars:""},
                  "Shift", "ShiftRight", KeyboardEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);

    // Control/RightControl key event
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Control,
                   modifiers:{ctrlKey:1}, chars:"", unmodifiedChars:""},
                  "Control", "ControlLeft", KeyboardEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Control,
                   modifiers:{ctrlKey:0}, chars:"", unmodifiedChars:""},
                  "Control", "ControlLeft", KeyboardEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightControl,
                   modifiers:{ctrlRightKey:1}, chars:"", unmodifiedChars:""},
                  "Control", "ControlRight", KeyboardEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightControl,
                   modifiers:{ctrlRightKey:0}, chars:"", unmodifiedChars:""},
                  "Control", "ControlRight", KeyboardEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);

    // Option/RightOption key event
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Option,
                   modifiers:{altKey:1}, chars:"", unmodifiedChars:""},
                  "Alt", "AltLeft", KeyboardEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Option,
                   modifiers:{altKey:0}, chars:"", unmodifiedChars:""},
                  "Alt", "AltLeft", KeyboardEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightOption,
                   modifiers:{altRightKey:1}, chars:"", unmodifiedChars:""},
                  "Alt", "AltRight", KeyboardEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightOption,
                   modifiers:{altRightKey:0}, chars:"", unmodifiedChars:""},
                  "Alt", "AltRight", KeyboardEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);

    // Command/RightCommand key event
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Command,
                   modifiers:{metaKey:1}, chars:"", unmodifiedChars:""},
                  "Meta", "MetaLeft", KeyboardEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Command,
                   modifiers:{metaKey:0}, chars:"", unmodifiedChars:""},
                  "Meta", "MetaLeft", KeyboardEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightCommand,
                   modifiers:{metaRightKey:1}, chars:"", unmodifiedChars:""},
                  "Meta", "MetaRight", KeyboardEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightCommand,
                   modifiers:{metaRightKey:0}, chars:"", unmodifiedChars:""},
                  "Meta", "MetaRight", KeyboardEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);

    // all keys on keyboard (keyCode test)
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Tab,
                   modifiers: {}, chars:"\t", unmodifiedChars:"\t"},
                  "Tab", "Tab", KeyboardEvent.DOM_VK_TAB, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadClear,
                   modifiers: {}, chars:"\uF739", unmodifiedChars:"\uF739"},
                  "Clear", "NumLock", KeyboardEvent.DOM_VK_CLEAR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Return,
                   modifiers: {}, chars:"\u000D", unmodifiedChars:"\u000D"},
                  "Enter", "Enter", KeyboardEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_Pause,
                   modifiers: {}, chars:"\uF712", unmodifiedChars:"\uF712"},
                  "F15", "F15", KeyboardEvent.DOM_VK_PAUSE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Escape,
                   modifiers: {}, chars:"\u001B", unmodifiedChars:"\u001B"},
                  "Escape", "Escape", KeyboardEvent.DOM_VK_ESCAPE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Space,
                   modifiers: {}, chars:" ", unmodifiedChars:" "},
                  " ", "Space", KeyboardEvent.DOM_VK_SPACE, " ", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PageUp,
                   modifiers: {}, chars:"\uF72C", unmodifiedChars:"\uF72C"},
                  "PageUp", "PageUp", KeyboardEvent.DOM_VK_PAGE_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PageDown,
                   modifiers: {}, chars:"\uF72D", unmodifiedChars:"\uF72D"},
                  "PageDown", "PageDown", KeyboardEvent.DOM_VK_PAGE_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_End,
                   modifiers: {}, chars:"\uF72B", unmodifiedChars:"\uF72B"},
                  "End", "End", KeyboardEvent.DOM_VK_END, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Home,
                   modifiers: {}, chars:"\uF729", unmodifiedChars:"\uF729"},
                  "Home", "Home", KeyboardEvent.DOM_VK_HOME, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_LeftArrow,
                   modifiers: {}, chars:"\uF702", unmodifiedChars:"\uF702"},
                  "ArrowLeft", "ArrowLeft", KeyboardEvent.DOM_VK_LEFT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_UpArrow,
                   modifiers: {}, chars:"\uF700", unmodifiedChars:"\uF700"},
                  "ArrowUp", "ArrowUp", KeyboardEvent.DOM_VK_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightArrow,
                   modifiers: {}, chars:"\uF703", unmodifiedChars:"\uF703"},
                  "ArrowRight", "ArrowRight", KeyboardEvent.DOM_VK_RIGHT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_DownArrow,
                   modifiers: {}, chars:"\uF701", unmodifiedChars:"\uF701"},
                  "ArrowDown", "ArrowDown", KeyboardEvent.DOM_VK_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_PrintScreen,
                   modifiers: {}, chars:"\uF710", unmodifiedChars:"\uF710"},
                  "F13", "F13", KeyboardEvent.DOM_VK_PRINTSCREEN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_Delete,
                   modifiers: {}, chars:"\uF728", unmodifiedChars:"\uF728"},
                  "Delete", "Delete", KeyboardEvent.DOM_VK_DELETE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_ScrollLock,
                   modifiers: {}, chars:"\uF711", unmodifiedChars:"\uF711"},
                  "F14", "F14", KeyboardEvent.DOM_VK_SCROLL_LOCK, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_ContextMenu,
                   modifiers: {}, chars:"\u0010", unmodifiedChars:"\u0010"},
                  "ContextMenu", "ContextMenu", KeyboardEvent.DOM_VK_CONTEXT_MENU, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);

    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F1,
                   modifiers:{fnKey:1}, chars:"\uF704", unmodifiedChars:"\uF704"},
                  "F1", "F1", KeyboardEvent.DOM_VK_F1, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F2,
                   modifiers:{fnKey:1}, chars:"\uF705", unmodifiedChars:"\uF705"},
                  "F2", "F2", KeyboardEvent.DOM_VK_F2, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F3,
                   modifiers:{fnKey:1}, chars:"\uF706", unmodifiedChars:"\uF706"},
                  "F3", "F3", KeyboardEvent.DOM_VK_F3, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F4,
                   modifiers:{fnKey:1}, chars:"\uF707", unmodifiedChars:"\uF707"},
                  "F4", "F4", KeyboardEvent.DOM_VK_F4, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F5,
                   modifiers:{fnKey:1}, chars:"\uF708", unmodifiedChars:"\uF708"},
                  "F5", "F5", KeyboardEvent.DOM_VK_F5, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F6,
                   modifiers:{fnKey:1}, chars:"\uF709", unmodifiedChars:"\uF709"},
                  "F6", "F6", KeyboardEvent.DOM_VK_F6, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F7,
                   modifiers:{fnKey:1}, chars:"\uF70A", unmodifiedChars:"\uF70A"},
                  "F7", "F7", KeyboardEvent.DOM_VK_F7, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F8,
                   modifiers:{fnKey:1}, chars:"\uF70B", unmodifiedChars:"\uF70B"},
                  "F8", "F8", KeyboardEvent.DOM_VK_F8, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F9,
                   modifiers:{fnKey:1}, chars:"\uF70C", unmodifiedChars:"\uF70C"},
                  "F9", "F9", KeyboardEvent.DOM_VK_F9, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F10,
                   modifiers:{fnKey:1}, chars:"\uF70D", unmodifiedChars:"\uF70D"},
                  "F10", "F10", KeyboardEvent.DOM_VK_F10, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F11,
                   modifiers:{fnKey:1}, chars:"\uF70E", unmodifiedChars:"\uF70E"},
                  "F11", "F11", KeyboardEvent.DOM_VK_F11, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F12,
                   modifiers:{fnKey:1}, chars:"\uF70F", unmodifiedChars:"\uF70F"},
                  "F12", "F12", KeyboardEvent.DOM_VK_F12, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F16,
                   modifiers:{fnKey:1}, chars:"\uF713", unmodifiedChars:"\uF713"},
                  "F16", "F16", KeyboardEvent.DOM_VK_F16, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F17,
                   modifiers:{fnKey:1}, chars:"\uF714", unmodifiedChars:"\uF714"},
                  "F17", "F17", KeyboardEvent.DOM_VK_F17, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F18,
                   modifiers:{fnKey:1}, chars:"\uF715", unmodifiedChars:"\uF715"},
                  "F18", "F18", KeyboardEvent.DOM_VK_F18, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F19,
                   modifiers:{fnKey:1}, chars:"\uF716", unmodifiedChars:"\uF716"},
                  "F19", "F19", KeyboardEvent.DOM_VK_F19, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);

    // US
    // Alphabet
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
                   modifiers: {}, chars:"a", unmodifiedChars:"a"},
                  "a", "KeyA", KeyboardEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
                   modifiers:{shiftKey:1}, chars:"A", unmodifiedChars:"A"},
                  "A", "KeyA", KeyboardEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
                   modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"},
                  "a", "KeyA", KeyboardEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
                   modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001", unmodifiedChars:"A"},
                  "A", "KeyA", KeyboardEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
                   modifiers:{ctrlKey:1, capsLockKey:1}, chars:"\u0001", unmodifiedChars:"a"},
                  "A", "KeyA", KeyboardEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
                   modifiers:{ctrlKey:1, shiftKey:1, capsLockKey:1}, chars:"\u0001", unmodifiedChars:"A"},
                  "A", "KeyA", KeyboardEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
                   modifiers:{altKey:1}, chars:"\u00E5", unmodifiedChars:"a"},
                  "\u00E5", "KeyA", KeyboardEvent.DOM_VK_A, "\u00E5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
                   modifiers:{altKey:1, shiftKey:1}, chars:"\u00C5", unmodifiedChars:"A"},
                  "\u00C5", "KeyA", KeyboardEvent.DOM_VK_A, "\u00C5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
                   modifiers:{altKey:1, ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"},
                  "\u00E5", "KeyA", KeyboardEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
                   modifiers:{altKey:1, ctrlKey:1, shiftKey:1}, chars:"\u0001", unmodifiedChars:"A"},
                  "\u00C5", "KeyA", KeyboardEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
                   modifiers:{metaKey:1}, chars:"a", unmodifiedChars:"a"},
                  "a", "KeyA", KeyboardEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B,
                   modifiers:{}, chars:"b", unmodifiedChars:"b"},
                  "b", "KeyB", KeyboardEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B,
                   modifiers:{shiftKey:1}, chars:"B", unmodifiedChars:"B"},
                  "B", "KeyB", KeyboardEvent.DOM_VK_B, "B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B,
                   modifiers:{ctrlKey:1}, chars:"\u0002", unmodifiedChars:"b"},
                  "b", "KeyB", KeyboardEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B,
                   modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0002", unmodifiedChars:"B"},
                  "B", "KeyB", KeyboardEvent.DOM_VK_B, "B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B,
                   modifiers:{altKey:1}, chars:"\u222B", unmodifiedChars:"b"},
                  "\u222B", "KeyB", KeyboardEvent.DOM_VK_B, "\u222B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B,
                   modifiers:{altKey:1, shiftKey:1}, chars:"\u0131", unmodifiedChars:"B"},
                  "\u0131", "KeyB", KeyboardEvent.DOM_VK_B, "\u0131", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B,
                   modifiers:{altKey:1, ctrlKey:1}, chars:"\u0002", unmodifiedChars:"b"},
                  "\u222B", "KeyB", KeyboardEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B,
                   modifiers:{altKey:1, ctrlKey:1, shiftKey:1}, chars:"\u0002", unmodifiedChars:"B"},
                  "\u0131", "KeyB", KeyboardEvent.DOM_VK_B, "B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B,
                   modifiers:{metaKey:1}, chars:"b", unmodifiedChars:"b"},
                  "b", "KeyB", KeyboardEvent.DOM_VK_B, "b", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C,
                   modifiers:{}, chars:"c", unmodifiedChars:"c"},
                  "c", "KeyC", KeyboardEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C,
                   modifiers:{shiftKey:1}, chars:"C", unmodifiedChars:"C"},
                  "C", "KeyC", KeyboardEvent.DOM_VK_C, "C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C,
                   modifiers:{ctrlKey:1}, chars:"\u0003", unmodifiedChars:"c"},
                  "c", "KeyC", KeyboardEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C,
                   modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0003", unmodifiedChars:"C"},
                  "C", "KeyC", KeyboardEvent.DOM_VK_C, "C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C,
                   modifiers:{altKey:1}, chars:"\u00E7", unmodifiedChars:"c"},
                  "\u00E7", "KeyC", KeyboardEvent.DOM_VK_C, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C,
                   modifiers:{altKey:1, shiftKey:1}, chars:"\u00C7", unmodifiedChars:"C"},
                  "\u00C7", "KeyC", KeyboardEvent.DOM_VK_C, "\u00C7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C,
                   modifiers:{altKey:1, ctrlKey:1}, chars:"\u0003", unmodifiedChars:"c"},
                  "\u00E7", "KeyC", KeyboardEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C,
                   modifiers:{altKey:1, ctrlKey:1, shiftKey:1}, chars:"\u0003", unmodifiedChars:"C"},
                  "\u00C7", "KeyC", KeyboardEvent.DOM_VK_C, "C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C,
                   modifiers:{metaKey:1}, chars:"c", unmodifiedChars:"c"},
                  "c", "KeyC", KeyboardEvent.DOM_VK_C, "c", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D,
                   modifiers:{}, chars:"d", unmodifiedChars:"d"},
                  "d", "KeyD", KeyboardEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D,
                   modifiers:{shiftKey:1}, chars:"D", unmodifiedChars:"D"},
                  "D", "KeyD", KeyboardEvent.DOM_VK_D, "D", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D,
                   modifiers:{ctrlKey:1}, chars:"\u0004", unmodifiedChars:"d"},
                  "d", "KeyD", KeyboardEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D,
                   modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0004", unmodifiedChars:"D"},
                  "D", "KeyD", KeyboardEvent.DOM_VK_D, "D", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D,
                   modifiers:{altKey:1}, chars:"\u2202", unmodifiedChars:"d"},
                  "\u2202", "KeyD", KeyboardEvent.DOM_VK_D, "\u2202", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D,
                   modifiers:{altKey:1, shiftKey:1}, chars:"\u00CE", unmodifiedChars:"D"},
                  "\u00CE", "KeyD", KeyboardEvent.DOM_VK_D, "\u00CE", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D,
                   modifiers:{altKey:1, ctrlKey:1}, chars:"\u0004", unmodifiedChars:"d"},
                  "\u2202", "KeyD", KeyboardEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D,
                   modifiers:{altKey:1, ctrlKey:1, shiftKey:1}, chars:"\u0004", unmodifiedChars:"D"},
                  "\u00CE", "KeyD", KeyboardEvent.DOM_VK_D, "D", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D,
                   modifiers:{metaKey:1}, chars:"d", unmodifiedChars:"d"},
                  "d", "KeyD", KeyboardEvent.DOM_VK_D, "d", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E,
                   modifiers:{}, chars:"e", unmodifiedChars:"e"},
                  "e", "KeyE", KeyboardEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E,
                   modifiers:{shiftKey:1}, chars:"E", unmodifiedChars:"E"},
                  "E", "KeyE", KeyboardEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E,
                   modifiers:{ctrlKey:1}, chars:"\u0005", unmodifiedChars:"e"},
                  "e", "KeyE", KeyboardEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E,
                   modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0005", unmodifiedChars:"E"},
                  "E", "KeyE", KeyboardEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E,
                   modifiers:{altKey:1}, chars:"", unmodifiedChars:"e"},
                  "Dead", "KeyE", KeyboardEvent.DOM_VK_E, "\u00B4", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E,
                   modifiers:{altKey:1, shiftKey:1}, chars:"\u00B4", unmodifiedChars:"E"},
                  "\u00B4", "KeyE", KeyboardEvent.DOM_VK_E, "\u00B4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E,
                   modifiers:{altKey:1, ctrlKey:1}, chars:"\u0005", unmodifiedChars:"e"},
                  "Dead", "KeyE", KeyboardEvent.DOM_VK_E, "e", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E,
                   modifiers:{altKey:1, ctrlKey:1, shiftKey:1}, chars:"\u0005", unmodifiedChars:"E"},
                  "\u00B4", "KeyE", KeyboardEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E,
                   modifiers:{metaKey:1}, chars:"e", unmodifiedChars:"e"},
                  "e", "KeyE", KeyboardEvent.DOM_VK_E, "e", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F,
                   modifiers:{}, chars:"f", unmodifiedChars:"f"},
                  "f", "KeyF", KeyboardEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F,
                   modifiers:{shiftKey:1}, chars:"F", unmodifiedChars:"F"},
                  "F", "KeyF", KeyboardEvent.DOM_VK_F, "F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F,
                   modifiers:{ctrlKey:1}, chars:"\u0006", unmodifiedChars:"f"},
                  "f", "KeyF", KeyboardEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F,
                   modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0006", unmodifiedChars:"F"},
                  "F", "KeyF", KeyboardEvent.DOM_VK_F, "F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F,
                   modifiers:{altKey:1}, chars:"\u0192", unmodifiedChars:"f"},
                  "\u0192", "KeyF", KeyboardEvent.DOM_VK_F, "\u0192", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F,
                   modifiers:{altKey:1, shiftKey:1}, chars:"\u00CF", unmodifiedChars:"F"},
                  "\u00CF", "KeyF", KeyboardEvent.DOM_VK_F, "\u00CF", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F,
                   modifiers:{altKey:1, ctrlKey:1}, chars:"\u0006", unmodifiedChars:"f"},
                  "\u0192", "KeyF", KeyboardEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F,
                   modifiers:{altKey:1, ctrlKey:1, shiftKey:1}, chars:"\u0006", unmodifiedChars:"F"},
                  "\u00CF", "KeyF", KeyboardEvent.DOM_VK_F, "F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    // XXX This test starts fullscreen mode.
    // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F,
    //                modifiers:{metaKey:1}, chars:"f", unmodifiedChars:"f"},
    //               "f", "KeyF", KeyboardEvent.DOM_VK_F, "f", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G,
                   modifiers:{}, chars:"g", unmodifiedChars:"g"},
                  "g", "KeyG", KeyboardEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G,
                   modifiers:{shiftKey:1}, chars:"G", unmodifiedChars:"G"},
                  "G", "KeyG", KeyboardEvent.DOM_VK_G, "G", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G,
                   modifiers:{ctrlKey:1}, chars:"\u0007", unmodifiedChars:"g"},
                  "g", "KeyG", KeyboardEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G,
                   modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0007", unmodifiedChars:"G"},
                  "G", "KeyG", KeyboardEvent.DOM_VK_G, "G", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G,
                   modifiers:{altKey:1}, chars:"\u00A9", unmodifiedChars:"g"},
                  "\u00A9", "KeyG", KeyboardEvent.DOM_VK_G, "\u00A9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G,
                   modifiers:{altKey:1, shiftKey:1}, chars:"\u02DD", unmodifiedChars:"G"},
                  "\u02DD", "KeyG", KeyboardEvent.DOM_VK_G, "\u02DD", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G,
                   modifiers:{altKey:1, ctrlKey:1}, chars:"\u0007", unmodifiedChars:"g"},
                  "\u00A9", "KeyG", KeyboardEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G,
                   modifiers:{altKey:1, ctrlKey:1, shiftKey:1}, chars:"\u0007", unmodifiedChars:"G"},
                  "\u02DD", "KeyG", KeyboardEvent.DOM_VK_G, "G", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G,
                   modifiers:{metaKey:1}, chars:"g", unmodifiedChars:"g"},
                  "g", "KeyG", KeyboardEvent.DOM_VK_G, "g", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H,
                   modifiers:{}, chars:"h", unmodifiedChars:"h"},
                  "h", "KeyH", KeyboardEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H,
                   modifiers:{shiftKey:1}, chars:"H", unmodifiedChars:"H"},
                  "H", "KeyH", KeyboardEvent.DOM_VK_H, "H", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H,
                   modifiers:{ctrlKey:1}, chars:"\u0008", unmodifiedChars:"h"},
                  "h", "KeyH", KeyboardEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H,
                   modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0008", unmodifiedChars:"H"},
                  "H", "KeyH", KeyboardEvent.DOM_VK_H, "H", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H,
                   modifiers:{altKey:1}, chars:"\u02D9", unmodifiedChars:"h"},
                  "\u02D9", "KeyH", KeyboardEvent.DOM_VK_H, "\u02D9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H,
                   modifiers:{altKey:1, shiftKey:1}, chars:"\u00D3", unmodifiedChars:"H"},
                  "\u00D3", "KeyH", KeyboardEvent.DOM_VK_H, "\u00D3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H,
                   modifiers:{altKey:1, ctrlKey:1}, chars:"\u0008", unmodifiedChars:"h"},
                  "\u02D9", "KeyH", KeyboardEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H,
                   modifiers:{altKey:1, ctrlKey:1, shiftKey:1}, chars:"\u0008", unmodifiedChars:"H"},
                  "\u00D3", "KeyH", KeyboardEvent.DOM_VK_H, "H", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
    yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H,
                   modifiers:{metaKey:1}, chars:"h", unmodifiedChars:"h"},
--> --------------------

--> maximum size reached

--> --------------------

[ zur Elbe Produktseite wechseln0.47Quellennavigators  Analyse erneut starten  ]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge