examples/3d/js/controls.js
function(pressed, event) {
    var state = this.codes[event.keyCode];

    if (!state) {
      return;
    }

    this.states[state] = pressed;
    event.preventDefault && event.preventDefault();
    event.stopPropagation && event.stopPropagation();
  }
function(pressed, event) {
    var state = this.codes[event.keyCode];

    if (!state) {
      return;
    }

    this.states[state] = pressed;
    event.preventDefault && event.preventDefault();
    event.stopPropagation && event.stopPropagation();
  }
function ( pressed , event ) { var state = this . codes [ event . keyCode ] ; if ( ! state ) { return ; } this . states [ state ] = pressed ; event . preventDefault && event . preventDefault ( ) ; event . stopPropagation && event . stopPropagation ( ) ; }
Handle all keydown and keyup events and update our internal controls state.
@param  {Boolean} pressed Whether or not the key is being pressed.
@param  {Object} event   DOM event data including the key being pressed.
Handle all keydown and keyup events and update our internal controls state .