code: function (id, buttonState) {
      var evtName;
      var previousButtonState = this.buttonStates[id];
  
      // Not changed.
      if (buttonState.pressed === previousButtonState.pressed) { return false; }
  
      evtName = buttonState.pressed ? EVENTS.BUTTONDOWN : EVENTS.BUTTONUP;
      this.el.emit(evtName, this.buttonEventDetails[id], false);
      previousButtonState.pressed = buttonState.pressed;
      return true;
    }
docs: Determine whether a button press has occured and emit events as appropriate.
  
  @param {string} id - ID of the button to check.
  @param {object} buttonState - State of the button to check.
  @returns {boolean} Whether button press state changed.