openJoystick method

Joystick openJoystick(
  1. int index
)

Open a joystick with the given index for use.

SDL Docs

Implementation

Joystick openJoystick(final int index) {
  final handle = sdl.SDL_JoystickOpen(index);
  if (handle == nullptr) {
    throw SdlError(0, getError());
  }
  final j = Joystick(this, handle);
  return j;
}