addon-test-support/@ember/test-helpers/dom/trigger-key-event.js
/**
  Calculates the value of KeyboardEvent#key given a keycode and the modifiers.
  Note that this works if the key is pressed in combination with the shift key, but it cannot
  detect if caps lock is enabled.
  @param {number} keycode The keycode of the event.
  @param {object} modifiers The modifiers of the event.
  @returns {string} The key string for the event.
 */
Calculates the value of KeyboardEvent#key given a keycode and the modifiers.
Note that this works if the key is pressed in combination with the shift key, but it cannot
detect if caps lock is enabled.
Calculates the value of KeyboardEvent#key given a keycode and the modifiers . Note that this works if the key is pressed in combination with the shift key but it cannot detect if caps lock is enabled .
function keyFromKeyCodeAndModifiers(keycode, modifiers) {
  if (keycode > 64 && keycode < 91) {
    if (modifiers.shiftKey) {
      return String.fromCharCode(keycode);
    } else {
      return String.fromCharCode(keycode).toLocaleLowerCase();
    }
  }
  let key = keyFromKeyCode[keycode];
  if (key) {
    return key;
  }
}
function keyFromKeyCodeAndModifiers ( keycode , modifiers ) { if ( keycode > 64 && keycode < 91 ) { if ( modifiers . shiftKey ) { return String . fromCharCode ( keycode ) ; } else { return String . fromCharCode ( keycode ) . toLocaleLowerCase ( ) ; } } let key = keyFromKeyCode [ keycode ] ; if ( key ) { return key ; } }
Calculates the value of KeyboardEvent#key given a keycode and the modifiers.
Calculates the value of KeyboardEvent#key given a keycode and the modifiers .