update method

void update(
  1. GamepadEvent event
)

Updates the state based on the given event.

Implementation

void update(GamepadEvent event) {
  switch (event.type) {
    case KeyType.analog:
      analogInputs[event.key] = event.value;
      break;
    case KeyType.button:
      buttonInputs[event.key] = event.value == 1;
      break;
  }
}