send method

void send(
  1. String id, {
  2. Set<int> buttons = const {},
  3. Map<String, double> axes = const {},
})

Sends a whole snapshot: buttons held (W3C indices) and axes.

Implementation

void send(
  String id, {
  Set<int> buttons = const {},
  Map<String, double> axes = const {},
}) {
  final state = gp.GamepadState(buttonsDown: buttons, axes: axes);
  _latest[id] = state;
  _states.add(gp.GamepadStateEvent(gamepadId: id, state: state));
}