sdl3/sdl_joystick library

Functions

sdlAttachVirtualJoystick(Pointer<SdlVirtualJoystickDesc> desc) → int joystick
Attach a new virtual joystick.
sdlCloseJoystick(Pointer<SdlJoystick> joystick) → void joystick
Close a joystick previously opened with SDL_OpenJoystick().
sdlDetachVirtualJoystick(int instanceId) → bool joystick
Detach a virtual joystick.
sdlGetJoystickAxis(Pointer<SdlJoystick> joystick, int axis) → int joystick
Get the current state of an axis control on a joystick.
sdlGetJoystickAxisInitialState(Pointer<SdlJoystick> joystick, int axis, Pointer<Int16> state) → bool joystick
Get the initial state of an axis control on a joystick.
sdlGetJoystickBall(Pointer<SdlJoystick> joystick, int ball, Pointer<Int32> dx, Pointer<Int32> dy) → bool joystick
Get the ball axis change since the last poll.
sdlGetJoystickButton(Pointer<SdlJoystick> joystick, int button) → bool joystick
Get the current state of a button on a joystick.
sdlGetJoystickConnectionState(Pointer<SdlJoystick> joystick) → int joystick
Get the connection state of a joystick.
sdlGetJoystickFirmwareVersion(Pointer<SdlJoystick> joystick) → int joystick
Get the firmware version of an opened joystick, if available.
sdlGetJoystickFromId(int instanceId) → Pointer<SdlJoystick> joystick
Get the SDL_Joystick associated with an instance ID, if it has been opened.
sdlGetJoystickFromPlayerIndex(int playerIndex) → Pointer<SdlJoystick> joystick
Get the SDL_Joystick associated with a player index.
sdlGetJoystickGuid(Pointer<SdlJoystick> joystick) → SdlGuid joystick
Get the implementation-dependent GUID for the joystick.
sdlGetJoystickGuidForId(int instanceId) → SdlGuid joystick
Get the implementation-dependent GUID of a joystick.
sdlGetJoystickGuidInfo(SdlGuid guid, Pointer<Uint16> vendor, Pointer<Uint16> product, Pointer<Uint16> version, Pointer<Uint16> crc16) → void joystick
Get the device information encoded in a SDL_GUID structure.
sdlGetJoystickHat(Pointer<SdlJoystick> joystick, int hat) → int joystick
Get the current state of a POV hat on a joystick.
sdlGetJoystickId(Pointer<SdlJoystick> joystick) → int joystick
Get the instance ID of an opened joystick.
sdlGetJoystickName(Pointer<SdlJoystick> joystick) → String? joystick
Get the implementation dependent name of a joystick.
sdlGetJoystickNameForId(int instanceId) → String? joystick
Get the implementation dependent name of a joystick.
sdlGetJoystickPath(Pointer<SdlJoystick> joystick) → String? joystick
Get the implementation dependent path of a joystick.
sdlGetJoystickPathForId(int instanceId) → String? joystick
Get the implementation dependent path of a joystick.
sdlGetJoystickPlayerIndex(Pointer<SdlJoystick> joystick) → int joystick
Get the player index of an opened joystick.
sdlGetJoystickPlayerIndexForId(int instanceId) → int joystick
Get the player index of a joystick.
sdlGetJoystickPowerInfo(Pointer<SdlJoystick> joystick, Pointer<Int32> percent) → int joystick
Get the battery state of a joystick.
sdlGetJoystickProduct(Pointer<SdlJoystick> joystick) → int joystick
Get the USB product ID of an opened joystick, if available.
sdlGetJoystickProductForId(int instanceId) → int joystick
Get the USB product ID of a joystick, if available.
sdlGetJoystickProductVersion(Pointer<SdlJoystick> joystick) → int joystick
Get the product version of an opened joystick, if available.
sdlGetJoystickProductVersionForId(int instanceId) → int joystick
Get the product version of a joystick, if available.
sdlGetJoystickProperties(Pointer<SdlJoystick> joystick) → int joystick
Get the properties associated with a joystick.
sdlGetJoysticks(Pointer<Int32> count) → Pointer<Uint32> joystick
Get a list of currently connected joysticks.
sdlGetJoystickSensorData(Pointer<SdlJoystick> joystick, int type, Pointer<Float> data, int numValues) → bool joystick
Get the current state of a joystick sensor.
sdlGetJoystickSensorDataRate(Pointer<SdlJoystick> joystick, int type) → double joystick
Get the data rate (number of events per second) of a joystick sensor.
sdlGetJoystickSerial(Pointer<SdlJoystick> joystick) → String? joystick
Get the serial number of an opened joystick, if available.
sdlGetJoystickType(Pointer<SdlJoystick> joystick) → int joystick
Get the type of an opened joystick.
sdlGetJoystickTypeForId(int instanceId) → int joystick
Get the type of a joystick, if available.
sdlGetJoystickVendor(Pointer<SdlJoystick> joystick) → int joystick
Get the USB vendor ID of an opened joystick, if available.
sdlGetJoystickVendorForId(int instanceId) → int joystick
Get the USB vendor ID of a joystick, if available.
sdlGetNumJoystickAxes(Pointer<SdlJoystick> joystick) → int joystick
Get the number of general axis controls on a joystick.
sdlGetNumJoystickBalls(Pointer<SdlJoystick> joystick) → int joystick
Get the number of trackballs on a joystick.
sdlGetNumJoystickButtons(Pointer<SdlJoystick> joystick) → int joystick
Get the number of buttons on a joystick.
sdlGetNumJoystickHats(Pointer<SdlJoystick> joystick) → int joystick
Get the number of POV hats on a joystick.
sdlHasJoystick() → bool joystick
Return whether a joystick is currently connected.
sdlIsJoystickVirtual(int instanceId) → bool joystick
Query whether or not a joystick is virtual.
sdlJoystickConnected(Pointer<SdlJoystick> joystick) → bool joystick
Get the status of a specified joystick.
sdlJoystickEventsEnabled() → bool joystick
Query the state of joystick event processing.
sdlJoystickHasSensor(Pointer<SdlJoystick> joystick, int type) → bool joystick
Return whether a joystick has a particular sensor.
sdlJoystickSensorEnabled(Pointer<SdlJoystick> joystick, int type) → bool joystick
Query whether sensor data reporting is enabled for a joystick.
sdlLockJoysticks() → void joystick
Locking for atomic access to the joystick API.
sdlOpenJoystick(int instanceId) → Pointer<SdlJoystick> joystick
Open a joystick for use.
sdlRumbleJoystick(Pointer<SdlJoystick> joystick, int lowFrequencyRumble, int highFrequencyRumble, int durationMs) → bool joystick
Start a rumble effect.
sdlRumbleJoystickTriggers(Pointer<SdlJoystick> joystick, int leftRumble, int rightRumble, int durationMs) → bool joystick
Start a rumble effect in the joystick's triggers.
sdlSendJoystickEffect(Pointer<SdlJoystick> joystick, Pointer<Void> data, int size) → bool joystick
Send a joystick specific effect packet.
sdlSendJoystickVirtualSensorData(Pointer<SdlJoystick> joystick, int type, int sensorTimestamp, Pointer<Float> data, int numValues) → bool joystick
Send a sensor update for an opened virtual joystick.
sdlSetJoystickEventsEnabled(bool enabled) → void joystick
Set the state of joystick event processing.
sdlSetJoystickLed(Pointer<SdlJoystick> joystick, int red, int green, int blue) → bool joystick
Update a joystick's LED color.
sdlSetJoystickPlayerIndex(Pointer<SdlJoystick> joystick, int playerIndex) → bool joystick
Set the player index of an opened joystick.
sdlSetJoystickSensorEnabled(Pointer<SdlJoystick> joystick, int type, bool enabled) → bool joystick
Set whether data reporting for a joystick sensor is enabled.
sdlSetJoystickVirtualAxis(Pointer<SdlJoystick> joystick, int axis, int value) → bool joystick
Set the state of an axis on an opened virtual joystick.
sdlSetJoystickVirtualBall(Pointer<SdlJoystick> joystick, int ball, int xrel, int yrel) → bool joystick
Generate ball motion on an opened virtual joystick.
sdlSetJoystickVirtualButton(Pointer<SdlJoystick> joystick, int button, bool down) → bool joystick
Set the state of a button on an opened virtual joystick.
sdlSetJoystickVirtualHat(Pointer<SdlJoystick> joystick, int hat, int value) → bool joystick
Set the state of a hat on an opened virtual joystick.
sdlSetJoystickVirtualTouchpad(Pointer<SdlJoystick> joystick, int touchpad, int finger, bool down, double x, double y, double pressure) → bool joystick
Set touchpad finger state on an opened virtual joystick.
sdlTryLockJoysticks() → bool joystick
Locking for atomic access to the joystick API.
sdlUnlockJoysticks() → void joystick
Unlocking for atomic access to the joystick API.
sdlUpdateJoysticks() → void joystick
Update the current state of the open joysticks.
sdlxAttachVirtualJoystick(SdlxVirtualJoystickDesc desc) → int joystick
Attach a new virtual joystick.
sdlxGetJoystickAxisInitialState(Pointer<SdlJoystick> joystick, int axis) → int? joystick
Get the initial state of an axis control on a joystick.
sdlxGetJoystickBall(Pointer<SdlJoystick> joystick, int ball) → ({int dx, int dy})? joystick
Get the ball axis change since the last poll.
sdlxGetJoystickGuidInfo(SdlGuid guid) → ({int crc16, int product, int vendor, int version}) joystick
Get the device information encoded in a SDL_GUID structure.
sdlxGetJoystickPowerInfo(Pointer<SdlJoystick> joystick) → ({int percent, int state}) joystick
Get the battery state of a joystick.
sdlxGetJoysticks() → List<int> joystick
Get a list of currently connected joysticks.
sdlxGetJoystickSensorData(Pointer<SdlJoystick> joystick, int type, int numValues) → List<double> joystick
Get the current state of a joystick sensor.
sdlxSendJoystickVirtualSensorData(Pointer<SdlJoystick> joystick, int type, int sensorTimestamp, List<double> data) → bool joystick
Send a sensor update for an opened virtual joystick.