function handleKeyEvent(e) {
  if (!getKeyboardOverlayId()) {
    return;
  }

  var modifiers = getModifiers(e);

  // To avoid flickering as the user releases the modifier keys that were held
  // to trigger the overlay, avoid updating in response to keyup events until at
  // least one keydown event has been received.
  if (!gotKeyDown) {
    if (e.type == 'keyup') {
      return;
    } else if (e.type == 'keydown') {
      gotKeyDown = true;
    }
  }

  var normModifiers = normalizeModifiers(modifiers);
  update(modifiers, normModifiers);

  var instructions = $('instructions');
  if (modifiers.length == 0) {
    instructions.style.visibility = 'visible';
  } else {
    instructions.style.visibility = 'hidden';
  }

  e.preventDefault();
}
/**
 * A callback function for onkeydown and onkeyup events.
 * @param {Event} e Key event.
 */
A callback function for onkeydown and onkeyup events.
@param {Event} e Key event.
A callback function for onkeydown and onkeyup events . @param { Event } e Key event .
function handleKeyEvent(e) {
  if (!getKeyboardOverlayId()) {
    return;
  }
  var modifiers = getModifiers(e);
  if (!gotKeyDown) {
    if (e.type == 'keyup') {
      return;
    } else if (e.type == 'keydown') {
      gotKeyDown = true;
    }
  }
  var normModifiers = normalizeModifiers(modifiers);
  update(modifiers, normModifiers);
  var instructions = $('instructions');
  if (modifiers.length == 0) {
    instructions.style.visibility = 'visible';
  } else {
    instructions.style.visibility = 'hidden';
  }
  e.preventDefault();
}
function handleKeyEvent ( e ) { if ( ! getKeyboardOverlayId ( ) ) { return ; } var modifiers = getModifiers ( e ) ; if ( ! gotKeyDown ) { if ( e . type == 'keyup' ) { return ; } else if ( e . type == 'keydown' ) { gotKeyDown = true ; } } var normModifiers = normalizeModifiers ( modifiers ) ; update ( modifiers , normModifiers ) ; var instructions = $ ( 'instructions' ) ; if ( modifiers . length == 0 ) { instructions . style . visibility = 'visible' ; } else { instructions . style . visibility = 'hidden' ; } e . preventDefault ( ) ; }
A callback function for onkeydown and onkeyup events.
A callback function for onkeydown and onkeyup events .
// To avoid flickering as the user releases the modifier keys that were held // to trigger the overlay, avoid updating in response to keyup events until at // least one keydown event has been received.