countDevices method

int countDevices()

Returns the number of currently connected and mapped gamepads.

This number of gamepads that the system is actively tracking, up to MAX_PORTS.

Implementation

int countDevices() {
  int result = 0;
  for (var slot in _deviceLookup) {
    if (slot != -1) result += 1;
  }
  return result;
}