keydown method

dynamic keydown(
  1. dynamic event
)

Implementation

keydown(event) {
  if (scope.enabled == false) return;

  // TODO
  // window.removeEventListener( 'keydown', keydown );

  if (_keyState != STATE.NONE) {
    return;
  } else if (event.code == scope.keys[STATE.ROTATE] && !scope.noRotate) {
    _keyState = STATE.ROTATE;
  } else if (event.code == scope.keys[STATE.ZOOM] && !scope.noZoom) {
    _keyState = STATE.ZOOM;
  } else if (event.code == scope.keys[STATE.PAN] && !scope.noPan) {
    _keyState = STATE.PAN;
  }
}