addon-test-support/@ember/test-helpers/dom/trigger-key-event.js
/**
 * Infers the keycode from the given key
 * @param {string} key The KeyboardEvent#key string
 * @returns {number} The keycode for the given key
 */
Infers the keycode from the given key
@param {string} key The KeyboardEvent#key string
@returns {number} The keycode for the given key
Infers the keycode from the given key @param { string } key The KeyboardEvent#key string @returns { number } The keycode for the given key
function keyCodeFromKey(key) {
  let keys = Object.keys(keyFromKeyCode);
  let keyCode = keys.find(keyCode => keyFromKeyCode[keyCode] === key);
  if (!keyCode) {
    keyCode = keys.find(keyCode => keyFromKeyCode[keyCode] === key.toLowerCase());
  }
  return parseInt(keyCode);
}
function keyCodeFromKey ( key ) { let keys = Object . keys ( keyFromKeyCode ) ; let keyCode = keys . find ( keyCode => keyFromKeyCode [ keyCode ] === key ) ; if ( ! keyCode ) { keyCode = keys . find ( keyCode => keyFromKeyCode [ keyCode ] === key . toLowerCase ( ) ) ; } return parseInt ( keyCode ) ; }
Infers the keycode from the given key
 @param {string} key The KeyboardEvent#key string
 @returns {number} The keycode for the given key
Infers the keycode from the given key @param { string } key The KeyboardEvent#key string @returns { number } The keycode for the given key