code: function KeyControlMethod(keyCode, parameter, velocity, friction, element) {
    if(!keyCode) {
      throw new Error("KeyControlMethod: keyCode must be defined");
    }
    if(!parameter) {
      throw new Error("KeyControlMethod: parameter must be defined");
    }
    if(!velocity) {
      throw new Error("KeyControlMethod: velocity must be defined");
    }
    if(!friction) {
      throw new Error("KeyControlMethod: friction must be defined");
    }
  
    element = element || document;
  
    this._keyCode = keyCode;
    this._parameter = parameter;
    this._velocity = velocity;
    this._friction = friction;
    this._element = element;
  
    this._keydownHandler = this._handlePress.bind(this);
    this._keyupHandler = this._handleRelease.bind(this);
    this._blurHandler = this._handleBlur.bind(this);
  
    this._element.addEventListener('keydown', this._keydownHandler);
    this._element.addEventListener('keyup', this._keyupHandler);
    window.addEventListener('blur', this._blurHandler);
  
    this._dynamics = new Dynamics();
    this._pressing = false;
  }
docs: @class KeyControlMethod
  @implements ControlMethod
  @classdesc
  
  Sets the velocity and friction of a single parameter by pressing and
  unpressing a key.
  
  @param {number} keyCode Key which activates the method when pressed
  @param {string} parameter The parameter to be controlled (e.g. `x`, `y` or `zoom`)
  @param {number} velocity Velocity at which the parameter changes. Use a
  negative number for opposite direction
  @param {number} friction Friction at which the parameter stops
  @param {Element} [element=document] DOM element where the key events are listened to