code: function(pressed, event) {
      var state = this.codes[event.keyCode];
  
      if (!state) {
        return;
      }
  
      this.states[state] = pressed;
      event.preventDefault && event.preventDefault();
      event.stopPropagation && event.stopPropagation();
    }
docs: 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.