| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
SDL3.Sys.Joystick
Contents
Description
SDL joystick support.
This is the lower-level joystick handling. If you want the simpler option, where what each button does is well-defined, you should use the gamepad API instead.
The term "instance_id" is the current instantiation of a joystick device in the system. If the joystick is removed and then re-inserted then it will get a new instance_id. instance_id's are monotonically increasing identifiers of a joystick plugged in.
The term "player_index" is the number assigned to a player on a specific controller. For XInput controllers this returns the XInput user index. Many joysticks will not be able to supply this information.
SDL_GUID is used as a stable 128-bit identifier for a joystick device that does not change over time. It identifies class of the device (a X360 wired controller for example). This identifier is platform dependent.
In order to use these functions, init must have been called with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system for joysticks, and load appropriate drivers.
If you would like to receive joystick updates while the application is in the background, you should set the following hint before calling init: SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
SDL can provide virtual joysticks as well: the app defines an imaginary controller with , and then can provide inputs for it via attachVirtualJoystick, setJoystickVirtualAxis, etc. As this data is supplied, it will look like a normal joystick to SDL, just not backed by a hardware driver. This has been used to make unusual devices, like VR headset controllers, look like normal joysticks, or provide recording/playback of game inputs, etc. The joystick structure used to identify an SDL joystick.setJoystickVirtualButton
This is opaque data.
FFI conventions
Unsuffixed aliases are unsafe foreign imports; aliases suffixed Safe are safe. Functions whose callbacks fire during the call export only the Safe alias (the genuine unsafe import stays reachable under SDL3.Sys.Bindgen.Joystick.Unsafe); functions curated unsafe-only export only the unsuffixed one. Each alias's documentation records its flavor and rationale.
Full conventions: SDL3.Sys.
Since: 3.2.0
Synopsis
- module SDL3.Sys.Bindgen.Joystick
- lockJoysticks :: IO ()
- lockJoysticksSafe :: IO ()
- unlockJoysticks :: IO ()
- unlockJoysticksSafe :: IO ()
- hasJoystick :: IO Bool
- hasJoystickSafe :: IO Bool
- getJoysticks :: Ptr CInt -> IO (Ptr SDL_JoystickID)
- getJoysticksSafe :: Ptr CInt -> IO (Ptr SDL_JoystickID)
- getJoystickNameForID :: SDL_JoystickID -> IO (PtrConst CChar)
- getJoystickNameForIDSafe :: SDL_JoystickID -> IO (PtrConst CChar)
- getJoystickPathForID :: SDL_JoystickID -> IO (PtrConst CChar)
- getJoystickPathForIDSafe :: SDL_JoystickID -> IO (PtrConst CChar)
- getJoystickPlayerIndexForID :: SDL_JoystickID -> IO Int32
- getJoystickPlayerIndexForIDSafe :: SDL_JoystickID -> IO Int32
- getJoystickGUIDForID :: SDL_JoystickID -> IO SDL_GUID
- getJoystickGUIDForIDSafe :: SDL_JoystickID -> IO SDL_GUID
- getJoystickVendorForID :: SDL_JoystickID -> IO Word16
- getJoystickVendorForIDSafe :: SDL_JoystickID -> IO Word16
- getJoystickProductForID :: SDL_JoystickID -> IO Word16
- getJoystickProductForIDSafe :: SDL_JoystickID -> IO Word16
- getJoystickProductVersionForID :: SDL_JoystickID -> IO Word16
- getJoystickProductVersionForIDSafe :: SDL_JoystickID -> IO Word16
- getJoystickTypeForID :: SDL_JoystickID -> IO SDL_JoystickType
- getJoystickTypeForIDSafe :: SDL_JoystickID -> IO SDL_JoystickType
- openJoystick :: SDL_JoystickID -> IO (Ptr SDL_Joystick)
- openJoystickSafe :: SDL_JoystickID -> IO (Ptr SDL_Joystick)
- getJoystickFromID :: SDL_JoystickID -> IO (Ptr SDL_Joystick)
- getJoystickFromIDSafe :: SDL_JoystickID -> IO (Ptr SDL_Joystick)
- getJoystickFromPlayerIndex :: Int32 -> IO (Ptr SDL_Joystick)
- getJoystickFromPlayerIndexSafe :: Int32 -> IO (Ptr SDL_Joystick)
- attachVirtualJoystick :: PtrConst SDL_VirtualJoystickDesc -> IO SDL_JoystickID
- attachVirtualJoystickSafe :: PtrConst SDL_VirtualJoystickDesc -> IO SDL_JoystickID
- detachVirtualJoystick :: SDL_JoystickID -> IO Bool
- detachVirtualJoystickSafe :: SDL_JoystickID -> IO Bool
- isJoystickVirtual :: SDL_JoystickID -> IO Bool
- isJoystickVirtualSafe :: SDL_JoystickID -> IO Bool
- setJoystickVirtualAxis :: Ptr SDL_Joystick -> Int32 -> Int16 -> IO Bool
- setJoystickVirtualAxisSafe :: Ptr SDL_Joystick -> Int32 -> Int16 -> IO Bool
- setJoystickVirtualBall :: Ptr SDL_Joystick -> Int32 -> Int16 -> Int16 -> IO Bool
- setJoystickVirtualBallSafe :: Ptr SDL_Joystick -> Int32 -> Int16 -> Int16 -> IO Bool
- setJoystickVirtualButton :: Ptr SDL_Joystick -> Int32 -> Bool -> IO Bool
- setJoystickVirtualButtonSafe :: Ptr SDL_Joystick -> Int32 -> Bool -> IO Bool
- setJoystickVirtualHat :: Ptr SDL_Joystick -> Int32 -> Word8 -> IO Bool
- setJoystickVirtualHatSafe :: Ptr SDL_Joystick -> Int32 -> Word8 -> IO Bool
- setJoystickVirtualTouchpad :: Ptr SDL_Joystick -> Int32 -> Int32 -> Bool -> Float -> Float -> Float -> IO Bool
- setJoystickVirtualTouchpadSafe :: Ptr SDL_Joystick -> Int32 -> Int32 -> Bool -> Float -> Float -> Float -> IO Bool
- sendJoystickVirtualSensorData :: Ptr SDL_Joystick -> SDL_SensorType -> Word64 -> PtrConst CFloat -> Int32 -> IO Bool
- sendJoystickVirtualSensorDataSafe :: Ptr SDL_Joystick -> SDL_SensorType -> Word64 -> PtrConst CFloat -> Int32 -> IO Bool
- getJoystickProperties :: Ptr SDL_Joystick -> IO SDL_PropertiesID
- getJoystickPropertiesSafe :: Ptr SDL_Joystick -> IO SDL_PropertiesID
- getJoystickName :: Ptr SDL_Joystick -> IO (PtrConst CChar)
- getJoystickNameSafe :: Ptr SDL_Joystick -> IO (PtrConst CChar)
- getJoystickPath :: Ptr SDL_Joystick -> IO (PtrConst CChar)
- getJoystickPathSafe :: Ptr SDL_Joystick -> IO (PtrConst CChar)
- getJoystickPlayerIndex :: Ptr SDL_Joystick -> IO Int32
- getJoystickPlayerIndexSafe :: Ptr SDL_Joystick -> IO Int32
- setJoystickPlayerIndex :: Ptr SDL_Joystick -> Int32 -> IO Bool
- setJoystickPlayerIndexSafe :: Ptr SDL_Joystick -> Int32 -> IO Bool
- getJoystickGUID :: Ptr SDL_Joystick -> IO SDL_GUID
- getJoystickGUIDSafe :: Ptr SDL_Joystick -> IO SDL_GUID
- getJoystickVendor :: Ptr SDL_Joystick -> IO Word16
- getJoystickVendorSafe :: Ptr SDL_Joystick -> IO Word16
- getJoystickProduct :: Ptr SDL_Joystick -> IO Word16
- getJoystickProductSafe :: Ptr SDL_Joystick -> IO Word16
- getJoystickProductVersion :: Ptr SDL_Joystick -> IO Word16
- getJoystickProductVersionSafe :: Ptr SDL_Joystick -> IO Word16
- getJoystickFirmwareVersion :: Ptr SDL_Joystick -> IO Word16
- getJoystickFirmwareVersionSafe :: Ptr SDL_Joystick -> IO Word16
- getJoystickSerial :: Ptr SDL_Joystick -> IO (PtrConst CChar)
- getJoystickSerialSafe :: Ptr SDL_Joystick -> IO (PtrConst CChar)
- getJoystickType :: Ptr SDL_Joystick -> IO SDL_JoystickType
- getJoystickTypeSafe :: Ptr SDL_Joystick -> IO SDL_JoystickType
- getJoystickGUIDInfo :: SDL_GUID -> Ptr Uint16 -> Ptr Uint16 -> Ptr Uint16 -> Ptr Uint16 -> IO ()
- getJoystickGUIDInfoSafe :: SDL_GUID -> Ptr Uint16 -> Ptr Uint16 -> Ptr Uint16 -> Ptr Uint16 -> IO ()
- joystickConnected :: Ptr SDL_Joystick -> IO Bool
- joystickConnectedSafe :: Ptr SDL_Joystick -> IO Bool
- getJoystickID :: Ptr SDL_Joystick -> IO SDL_JoystickID
- getJoystickIDSafe :: Ptr SDL_Joystick -> IO SDL_JoystickID
- getNumJoystickAxes :: Ptr SDL_Joystick -> IO Int32
- getNumJoystickAxesSafe :: Ptr SDL_Joystick -> IO Int32
- getNumJoystickBalls :: Ptr SDL_Joystick -> IO Int32
- getNumJoystickBallsSafe :: Ptr SDL_Joystick -> IO Int32
- getNumJoystickHats :: Ptr SDL_Joystick -> IO Int32
- getNumJoystickHatsSafe :: Ptr SDL_Joystick -> IO Int32
- getNumJoystickButtons :: Ptr SDL_Joystick -> IO Int32
- getNumJoystickButtonsSafe :: Ptr SDL_Joystick -> IO Int32
- setJoystickEventsEnabled :: Bool -> IO ()
- setJoystickEventsEnabledSafe :: Bool -> IO ()
- joystickEventsEnabled :: IO Bool
- joystickEventsEnabledSafe :: IO Bool
- updateJoysticks :: IO ()
- updateJoysticksSafe :: IO ()
- getJoystickAxis :: Ptr SDL_Joystick -> Int32 -> IO Int16
- getJoystickAxisSafe :: Ptr SDL_Joystick -> Int32 -> IO Int16
- getJoystickAxisInitialState :: Ptr SDL_Joystick -> Int32 -> Ptr Sint16 -> IO Bool
- getJoystickAxisInitialStateSafe :: Ptr SDL_Joystick -> Int32 -> Ptr Sint16 -> IO Bool
- getJoystickBall :: Ptr SDL_Joystick -> Int32 -> Ptr CInt -> Ptr CInt -> IO Bool
- getJoystickBallSafe :: Ptr SDL_Joystick -> Int32 -> Ptr CInt -> Ptr CInt -> IO Bool
- getJoystickHat :: Ptr SDL_Joystick -> Int32 -> IO Word8
- getJoystickHatSafe :: Ptr SDL_Joystick -> Int32 -> IO Word8
- getJoystickButton :: Ptr SDL_Joystick -> Int32 -> IO Bool
- getJoystickButtonSafe :: Ptr SDL_Joystick -> Int32 -> IO Bool
- rumbleJoystick :: Ptr SDL_Joystick -> Word16 -> Word16 -> Word32 -> IO Bool
- rumbleJoystickSafe :: Ptr SDL_Joystick -> Word16 -> Word16 -> Word32 -> IO Bool
- rumbleJoystickTriggers :: Ptr SDL_Joystick -> Word16 -> Word16 -> Word32 -> IO Bool
- rumbleJoystickTriggersSafe :: Ptr SDL_Joystick -> Word16 -> Word16 -> Word32 -> IO Bool
- setJoystickLED :: Ptr SDL_Joystick -> Word8 -> Word8 -> Word8 -> IO Bool
- setJoystickLEDSafe :: Ptr SDL_Joystick -> Word8 -> Word8 -> Word8 -> IO Bool
- sendJoystickEffect :: Ptr SDL_Joystick -> PtrConst Void -> Int32 -> IO Bool
- sendJoystickEffectSafe :: Ptr SDL_Joystick -> PtrConst Void -> Int32 -> IO Bool
- closeJoystick :: Ptr SDL_Joystick -> IO ()
- closeJoystickSafe :: Ptr SDL_Joystick -> IO ()
- getJoystickConnectionState :: Ptr SDL_Joystick -> IO SDL_JoystickConnectionState
- getJoystickConnectionStateSafe :: Ptr SDL_Joystick -> IO SDL_JoystickConnectionState
- getJoystickPowerInfo :: Ptr SDL_Joystick -> Ptr CInt -> IO SDL_PowerState
- getJoystickPowerInfoSafe :: Ptr SDL_Joystick -> Ptr CInt -> IO SDL_PowerState
Documentation
module SDL3.Sys.Bindgen.Joystick
Function aliases
lockJoysticks :: IO () Source #
Locking for atomic access to the joystick API.
The SDL joystick functions are thread-safe, however you can lock the joysticks while processing to guarantee that the joystick list won't change and joystick and gamepad events will not be delivered.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_LockJoysticks. The safe flavor islockJoysticksSafe. - C declaration
SDL_LockJoysticks, defined atSDL3/SDL_joystick.h 189:34
Since: 3.2.0
lockJoysticksSafe :: IO () Source #
Locking for atomic access to the joystick API.
The SDL joystick functions are thread-safe, however you can lock the joysticks while processing to guarantee that the joystick list won't change and joystick and gamepad events will not be delivered.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_LockJoysticks. The unsafe flavor islockJoysticks. - C declaration
SDL_LockJoysticks, defined atSDL3/SDL_joystick.h 189:34
Since: 3.2.0
unlockJoysticks :: IO () Source #
Unlocking for atomic access to the joystick API.
- Thread safety
- This should be called from the same thread that called
.lockJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_UnlockJoysticks. The safe flavor isunlockJoysticksSafe. - C declaration
SDL_UnlockJoysticks, defined atSDL3/SDL_joystick.h 199:34
Since: 3.2.0
unlockJoysticksSafe :: IO () Source #
Unlocking for atomic access to the joystick API.
- Thread safety
- This should be called from the same thread that called
.lockJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_UnlockJoysticks. The unsafe flavor isunlockJoysticks. - C declaration
SDL_UnlockJoysticks, defined atSDL3/SDL_joystick.h 199:34
Since: 3.2.0
hasJoystick :: IO Bool Source #
Return whether a joystick is currently connected.
- Returns
- true if a joystick is connected, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_HasJoystick. The safe flavor ishasJoystickSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasJoystick, defined atSDL3/SDL_joystick.h 212:34
Since: 3.2.0
hasJoystickSafe :: IO Bool Source #
Return whether a joystick is currently connected.
- Returns
- true if a joystick is connected, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_HasJoystick. The unsafe flavor ishasJoystick. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasJoystick, defined atSDL3/SDL_joystick.h 212:34
Since: 3.2.0
Arguments
| :: Ptr CInt |
|
| -> IO (Ptr SDL_JoystickID) |
Get a list of currently connected joysticks.
- Returns
- a 0 terminated array of joystick instance IDs or NULL on failure; call
getErrorfor more information. This should be freed withfreewhen it is no longer needed. - Thread safety
- It is safe to call this function from any thread.
- See also
hasJoystick,openJoystick
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoysticks. The safe flavor isgetJoysticksSafe. - C declaration
SDL_GetJoysticks, defined atSDL3/SDL_joystick.h 230:46
Since: 3.2.0
Arguments
| :: Ptr CInt |
|
| -> IO (Ptr SDL_JoystickID) |
Get a list of currently connected joysticks.
- Returns
- a 0 terminated array of joystick instance IDs or NULL on failure; call
getErrorfor more information. This should be freed withfreewhen it is no longer needed. - Thread safety
- It is safe to call this function from any thread.
- See also
hasJoystick,openJoystick
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoysticks. The unsafe flavor isgetJoysticks. - C declaration
SDL_GetJoysticks, defined atSDL3/SDL_joystick.h 230:46
Since: 3.2.0
Arguments
| :: SDL_JoystickID |
|
| -> IO (PtrConst CChar) |
Get the implementation dependent name of a joystick.
This can be called before any joysticks are opened.
- Returns
- the name of the selected joystick. If no name can be found, this function returns NULL; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickName,getJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickNameForID. The safe flavor isgetJoystickNameForIDSafe. - C declaration
SDL_GetJoystickNameForID, defined atSDL3/SDL_joystick.h 248:42
Since: 3.2.0
getJoystickNameForIDSafe Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO (PtrConst CChar) |
Get the implementation dependent name of a joystick.
This can be called before any joysticks are opened.
- Returns
- the name of the selected joystick. If no name can be found, this function returns NULL; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickName,getJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickNameForID. The unsafe flavor isgetJoystickNameForID. - C declaration
SDL_GetJoystickNameForID, defined atSDL3/SDL_joystick.h 248:42
Since: 3.2.0
Arguments
| :: SDL_JoystickID |
|
| -> IO (PtrConst CChar) |
Get the implementation dependent path of a joystick.
This can be called before any joysticks are opened.
- Returns
- the path of the selected joystick. If no path can be found, this function returns NULL; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickPath,getJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickPathForID. The safe flavor isgetJoystickPathForIDSafe. - C declaration
SDL_GetJoystickPathForID, defined atSDL3/SDL_joystick.h 266:42
Since: 3.2.0
getJoystickPathForIDSafe Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO (PtrConst CChar) |
Get the implementation dependent path of a joystick.
This can be called before any joysticks are opened.
- Returns
- the path of the selected joystick. If no path can be found, this function returns NULL; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickPath,getJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickPathForID. The unsafe flavor isgetJoystickPathForID. - C declaration
SDL_GetJoystickPathForID, defined atSDL3/SDL_joystick.h 266:42
Since: 3.2.0
getJoystickPlayerIndexForID Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO Int32 |
Get the player index of a joystick.
This can be called before any joysticks are opened.
- Returns
- the player index of a joystick, or -1 if it's not available.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickPlayerIndex,getJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickPlayerIndexForID. The safe flavor isgetJoystickPlayerIndexForIDSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickPlayerIndexForID, defined atSDL3/SDL_joystick.h 283:33
Since: 3.2.0
getJoystickPlayerIndexForIDSafe Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO Int32 |
Get the player index of a joystick.
This can be called before any joysticks are opened.
- Returns
- the player index of a joystick, or -1 if it's not available.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickPlayerIndex,getJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickPlayerIndexForID. The unsafe flavor isgetJoystickPlayerIndexForID. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickPlayerIndexForID, defined atSDL3/SDL_joystick.h 283:33
Since: 3.2.0
Arguments
| :: SDL_JoystickID |
|
| -> IO SDL_GUID |
Get the implementation-dependent GUID of a joystick.
This can be called before any joysticks are opened.
- Returns
- the GUID of the selected joystick. If called with an invalid instance_id, this function returns a zero GUID.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickGUID,guidToString
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickGUIDForID. The safe flavor isgetJoystickGUIDForIDSafe. - C declaration
SDL_GetJoystickGUIDForID, defined atSDL3/SDL_joystick.h 301:38
Since: 3.2.0
getJoystickGUIDForIDSafe Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO SDL_GUID |
Get the implementation-dependent GUID of a joystick.
This can be called before any joysticks are opened.
- Returns
- the GUID of the selected joystick. If called with an invalid instance_id, this function returns a zero GUID.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickGUID,guidToString
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickGUIDForID. The unsafe flavor isgetJoystickGUIDForID. - C declaration
SDL_GetJoystickGUIDForID, defined atSDL3/SDL_joystick.h 301:38
Since: 3.2.0
getJoystickVendorForID Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO Word16 |
Get the USB vendor ID of a joystick, if available.
This can be called before any joysticks are opened. If the vendor ID isn't available this function returns 0.
- Returns
- the USB vendor ID of the selected joystick. If called with an invalid instance_id, this function returns 0.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickVendor,getJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickVendorForID. The safe flavor isgetJoystickVendorForIDSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickVendorForID, defined atSDL3/SDL_joystick.h 320:36
Since: 3.2.0
getJoystickVendorForIDSafe Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO Word16 |
Get the USB vendor ID of a joystick, if available.
This can be called before any joysticks are opened. If the vendor ID isn't available this function returns 0.
- Returns
- the USB vendor ID of the selected joystick. If called with an invalid instance_id, this function returns 0.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickVendor,getJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickVendorForID. The unsafe flavor isgetJoystickVendorForID. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickVendorForID, defined atSDL3/SDL_joystick.h 320:36
Since: 3.2.0
getJoystickProductForID Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO Word16 |
Get the USB product ID of a joystick, if available.
This can be called before any joysticks are opened. If the product ID isn't available this function returns 0.
- Returns
- the USB product ID of the selected joystick. If called with an invalid instance_id, this function returns 0.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickProduct,getJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickProductForID. The safe flavor isgetJoystickProductForIDSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickProductForID, defined atSDL3/SDL_joystick.h 339:36
Since: 3.2.0
getJoystickProductForIDSafe Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO Word16 |
Get the USB product ID of a joystick, if available.
This can be called before any joysticks are opened. If the product ID isn't available this function returns 0.
- Returns
- the USB product ID of the selected joystick. If called with an invalid instance_id, this function returns 0.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickProduct,getJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickProductForID. The unsafe flavor isgetJoystickProductForID. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickProductForID, defined atSDL3/SDL_joystick.h 339:36
Since: 3.2.0
getJoystickProductVersionForID Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO Word16 |
Get the product version of a joystick, if available.
This can be called before any joysticks are opened. If the product version isn't available this function returns 0.
- Returns
- the product version of the selected joystick. If called with an invalid instance_id, this function returns 0.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickProductVersion,getJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickProductVersionForID. The safe flavor isgetJoystickProductVersionForIDSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickProductVersionForID, defined atSDL3/SDL_joystick.h 358:36
Since: 3.2.0
getJoystickProductVersionForIDSafe Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO Word16 |
Get the product version of a joystick, if available.
This can be called before any joysticks are opened. If the product version isn't available this function returns 0.
- Returns
- the product version of the selected joystick. If called with an invalid instance_id, this function returns 0.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickProductVersion,getJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickProductVersionForID. The unsafe flavor isgetJoystickProductVersionForID. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickProductVersionForID, defined atSDL3/SDL_joystick.h 358:36
Since: 3.2.0
Arguments
| :: SDL_JoystickID |
|
| -> IO SDL_JoystickType |
Get the type of a joystick, if available.
This can be called before any joysticks are opened.
- Returns
- the
SDL_JoystickTypeof the selected joystick. If called with an invalid instance_id, this function returnsSDL_JOYSTICK_TYPE_UNKNOWN. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickType,getJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickTypeForID. The safe flavor isgetJoystickTypeForIDSafe. - C declaration
SDL_GetJoystickTypeForID, defined atSDL3/SDL_joystick.h 377:46
Since: 3.2.0
getJoystickTypeForIDSafe Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO SDL_JoystickType |
Get the type of a joystick, if available.
This can be called before any joysticks are opened.
- Returns
- the
SDL_JoystickTypeof the selected joystick. If called with an invalid instance_id, this function returnsSDL_JOYSTICK_TYPE_UNKNOWN. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickType,getJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickTypeForID. The unsafe flavor isgetJoystickTypeForID. - C declaration
SDL_GetJoystickTypeForID, defined atSDL3/SDL_joystick.h 377:46
Since: 3.2.0
Arguments
| :: SDL_JoystickID |
|
| -> IO (Ptr SDL_Joystick) |
Open a joystick for use.
The joystick subsystem must be initialized before a joystick can be opened for use.
- Returns
- a joystick identifier or NULL on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
closeJoystick
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_OpenJoystick. The safe flavor isopenJoystickSafe. - C declaration
SDL_OpenJoystick, defined atSDL3/SDL_joystick.h 395:44
Since: 3.2.0
Arguments
| :: SDL_JoystickID |
|
| -> IO (Ptr SDL_Joystick) |
Open a joystick for use.
The joystick subsystem must be initialized before a joystick can be opened for use.
- Returns
- a joystick identifier or NULL on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
closeJoystick
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_OpenJoystick. The unsafe flavor isopenJoystick. - C declaration
SDL_OpenJoystick, defined atSDL3/SDL_joystick.h 395:44
Since: 3.2.0
Arguments
| :: SDL_JoystickID |
|
| -> IO (Ptr SDL_Joystick) |
Get the SDL_Joystick associated with an instance ID, if it has been opened.
- Returns
- an
SDL_Joystickon success or NULL on failure or if it hasn't been opened yet; callgetErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickFromID. The safe flavor isgetJoystickFromIDSafe. - C declaration
SDL_GetJoystickFromID, defined atSDL3/SDL_joystick.h 408:44
Since: 3.2.0
getJoystickFromIDSafe Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO (Ptr SDL_Joystick) |
Get the SDL_Joystick associated with an instance ID, if it has been opened.
- Returns
- an
SDL_Joystickon success or NULL on failure or if it hasn't been opened yet; callgetErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickFromID. The unsafe flavor isgetJoystickFromID. - C declaration
SDL_GetJoystickFromID, defined atSDL3/SDL_joystick.h 408:44
Since: 3.2.0
getJoystickFromPlayerIndex Source #
Arguments
| :: Int32 |
|
| -> IO (Ptr SDL_Joystick) |
Get the SDL_Joystick associated with a player index.
- Returns
- an
SDL_Joystickon success or NULL on failure; callgetErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickPlayerIndex,setJoystickPlayerIndex
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickFromPlayerIndex. The safe flavor isgetJoystickFromPlayerIndexSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickFromPlayerIndex, defined atSDL3/SDL_joystick.h 424:44
Since: 3.2.0
getJoystickFromPlayerIndexSafe Source #
Arguments
| :: Int32 |
|
| -> IO (Ptr SDL_Joystick) |
Get the SDL_Joystick associated with a player index.
- Returns
- an
SDL_Joystickon success or NULL on failure; callgetErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickPlayerIndex,setJoystickPlayerIndex
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickFromPlayerIndex. The unsafe flavor isgetJoystickFromPlayerIndex. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickFromPlayerIndex, defined atSDL3/SDL_joystick.h 424:44
Since: 3.2.0
attachVirtualJoystick Source #
Arguments
| :: PtrConst SDL_VirtualJoystickDesc |
|
| -> IO SDL_JoystickID |
Attach a new virtual joystick.
Apps can create virtual joysticks, that exist without hardware directly backing them, and have program-supplied inputs. Once attached, a virtual joystick looks like any other joystick that SDL can access. These can be used to make other things look like joysticks, or provide pre-recorded input, etc.
Once attached, the app can send joystick inputs to the new virtual joystick using , etc.setJoystickVirtualAxis
When no longer needed, the virtual joystick can be removed by calling .detachVirtualJoystick
- Returns
- the joystick instance ID, or 0 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
detachVirtualJoystick,setJoystickVirtualAxis,setJoystickVirtualButton,setJoystickVirtualBall,setJoystickVirtualHat,setJoystickVirtualTouchpad, SDL_SetJoystickVirtualSensorData
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_AttachVirtualJoystick. The safe flavor isattachVirtualJoystickSafe. - C declaration
SDL_AttachVirtualJoystick, defined atSDL3/SDL_joystick.h 539:44
Since: 3.2.0
attachVirtualJoystickSafe Source #
Arguments
| :: PtrConst SDL_VirtualJoystickDesc |
|
| -> IO SDL_JoystickID |
Attach a new virtual joystick.
Apps can create virtual joysticks, that exist without hardware directly backing them, and have program-supplied inputs. Once attached, a virtual joystick looks like any other joystick that SDL can access. These can be used to make other things look like joysticks, or provide pre-recorded input, etc.
Once attached, the app can send joystick inputs to the new virtual joystick using , etc.setJoystickVirtualAxis
When no longer needed, the virtual joystick can be removed by calling .detachVirtualJoystick
- Returns
- the joystick instance ID, or 0 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
detachVirtualJoystick,setJoystickVirtualAxis,setJoystickVirtualButton,setJoystickVirtualBall,setJoystickVirtualHat,setJoystickVirtualTouchpad, SDL_SetJoystickVirtualSensorData
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_AttachVirtualJoystick. The unsafe flavor isattachVirtualJoystick. - C declaration
SDL_AttachVirtualJoystick, defined atSDL3/SDL_joystick.h 539:44
Since: 3.2.0
detachVirtualJoystick Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO Bool |
Detach a virtual joystick.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
attachVirtualJoystick
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_DetachVirtualJoystick. The safe flavor isdetachVirtualJoystickSafe: a virtual joystick's cleanup callback runs synchronously. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_DetachVirtualJoystick, defined atSDL3/SDL_joystick.h 555:34
Since: 3.2.0
detachVirtualJoystickSafe Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO Bool |
Detach a virtual joystick.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
attachVirtualJoystick
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_DetachVirtualJoystick. The unsafe flavor isdetachVirtualJoystick: a virtual joystick's cleanup callback runs synchronously. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_DetachVirtualJoystick, defined atSDL3/SDL_joystick.h 555:34
Since: 3.2.0
Arguments
| :: SDL_JoystickID |
|
| -> IO Bool |
Query whether or not a joystick is virtual.
- Returns
- true if the joystick is virtual, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_IsJoystickVirtual. The safe flavor isisJoystickVirtualSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_IsJoystickVirtual, defined atSDL3/SDL_joystick.h 567:34
Since: 3.2.0
isJoystickVirtualSafe Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO Bool |
Query whether or not a joystick is virtual.
- Returns
- true if the joystick is virtual, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_IsJoystickVirtual. The unsafe flavor isisJoystickVirtual. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_IsJoystickVirtual, defined atSDL3/SDL_joystick.h 567:34
Since: 3.2.0
setJoystickVirtualAxis Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> Int16 |
|
| -> IO Bool |
Set the state of an axis on an opened virtual joystick.
Please note that values set here will not be applied until the next call to updateJoysticks, which can either be called directly, or can be called indirectly through various other SDL APIs, including, but not limited to the following: pollEvent, pumpEvents, waitEventTimeout, waitEvent.
Note that when sending trigger axes, you should scale the value to the full range of Sint16. For example, a trigger at rest would have the value of .sDL_JOYSTICK_AXIS_MIN
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
setJoystickVirtualButton,setJoystickVirtualBall,setJoystickVirtualHat,setJoystickVirtualTouchpad, SDL_SetJoystickVirtualSensorData
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetJoystickVirtualAxis. The safe flavor issetJoystickVirtualAxisSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetJoystickVirtualAxis, defined atSDL3/SDL_joystick.h 598:34
Since: 3.2.0
setJoystickVirtualAxisSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> Int16 |
|
| -> IO Bool |
Set the state of an axis on an opened virtual joystick.
Please note that values set here will not be applied until the next call to updateJoysticks, which can either be called directly, or can be called indirectly through various other SDL APIs, including, but not limited to the following: pollEvent, pumpEvents, waitEventTimeout, waitEvent.
Note that when sending trigger axes, you should scale the value to the full range of Sint16. For example, a trigger at rest would have the value of .sDL_JOYSTICK_AXIS_MIN
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
setJoystickVirtualButton,setJoystickVirtualBall,setJoystickVirtualHat,setJoystickVirtualTouchpad, SDL_SetJoystickVirtualSensorData
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetJoystickVirtualAxis. The unsafe flavor issetJoystickVirtualAxis. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetJoystickVirtualAxis, defined atSDL3/SDL_joystick.h 598:34
Since: 3.2.0
setJoystickVirtualBall Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> Int16 |
|
| -> Int16 |
|
| -> IO Bool |
Generate ball motion on an opened virtual joystick.
Please note that values set here will not be applied until the next call to updateJoysticks, which can either be called directly, or can be called indirectly through various other SDL APIs, including, but not limited to the following: pollEvent, pumpEvents, waitEventTimeout, waitEvent.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
setJoystickVirtualAxis,setJoystickVirtualButton,setJoystickVirtualHat,setJoystickVirtualTouchpad, SDL_SetJoystickVirtualSensorData
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetJoystickVirtualBall. The safe flavor issetJoystickVirtualBallSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetJoystickVirtualBall, defined atSDL3/SDL_joystick.h 626:34
Since: 3.2.0
setJoystickVirtualBallSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> Int16 |
|
| -> Int16 |
|
| -> IO Bool |
Generate ball motion on an opened virtual joystick.
Please note that values set here will not be applied until the next call to updateJoysticks, which can either be called directly, or can be called indirectly through various other SDL APIs, including, but not limited to the following: pollEvent, pumpEvents, waitEventTimeout, waitEvent.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
setJoystickVirtualAxis,setJoystickVirtualButton,setJoystickVirtualHat,setJoystickVirtualTouchpad, SDL_SetJoystickVirtualSensorData
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetJoystickVirtualBall. The unsafe flavor issetJoystickVirtualBall. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetJoystickVirtualBall, defined atSDL3/SDL_joystick.h 626:34
Since: 3.2.0
setJoystickVirtualButton Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> Bool |
|
| -> IO Bool |
Set the state of a button on an opened virtual joystick.
Please note that values set here will not be applied until the next call to updateJoysticks, which can either be called directly, or can be called indirectly through various other SDL APIs, including, but not limited to the following: pollEvent, pumpEvents, waitEventTimeout, waitEvent.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
setJoystickVirtualAxis,setJoystickVirtualBall,setJoystickVirtualHat,setJoystickVirtualTouchpad, SDL_SetJoystickVirtualSensorData
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetJoystickVirtualButton. The safe flavor issetJoystickVirtualButtonSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetJoystickVirtualButton, defined atSDL3/SDL_joystick.h 653:34
Since: 3.2.0
setJoystickVirtualButtonSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> Bool |
|
| -> IO Bool |
Set the state of a button on an opened virtual joystick.
Please note that values set here will not be applied until the next call to updateJoysticks, which can either be called directly, or can be called indirectly through various other SDL APIs, including, but not limited to the following: pollEvent, pumpEvents, waitEventTimeout, waitEvent.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
setJoystickVirtualAxis,setJoystickVirtualBall,setJoystickVirtualHat,setJoystickVirtualTouchpad, SDL_SetJoystickVirtualSensorData
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetJoystickVirtualButton. The unsafe flavor issetJoystickVirtualButton. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetJoystickVirtualButton, defined atSDL3/SDL_joystick.h 653:34
Since: 3.2.0
setJoystickVirtualHat Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> Word8 |
|
| -> IO Bool |
Set the state of a hat on an opened virtual joystick.
Please note that values set here will not be applied until the next call to updateJoysticks, which can either be called directly, or can be called indirectly through various other SDL APIs, including, but not limited to the following: pollEvent, pumpEvents, waitEventTimeout, waitEvent.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
setJoystickVirtualAxis,setJoystickVirtualButton,setJoystickVirtualBall,setJoystickVirtualTouchpad, SDL_SetJoystickVirtualSensorData
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetJoystickVirtualHat. The safe flavor issetJoystickVirtualHatSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetJoystickVirtualHat, defined atSDL3/SDL_joystick.h 680:34
Since: 3.2.0
setJoystickVirtualHatSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> Word8 |
|
| -> IO Bool |
Set the state of a hat on an opened virtual joystick.
Please note that values set here will not be applied until the next call to updateJoysticks, which can either be called directly, or can be called indirectly through various other SDL APIs, including, but not limited to the following: pollEvent, pumpEvents, waitEventTimeout, waitEvent.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
setJoystickVirtualAxis,setJoystickVirtualButton,setJoystickVirtualBall,setJoystickVirtualTouchpad, SDL_SetJoystickVirtualSensorData
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetJoystickVirtualHat. The unsafe flavor issetJoystickVirtualHat. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetJoystickVirtualHat, defined atSDL3/SDL_joystick.h 680:34
Since: 3.2.0
setJoystickVirtualTouchpad Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> Int32 |
|
| -> Bool |
|
| -> Float |
|
| -> Float |
|
| -> Float |
|
| -> IO Bool |
Set touchpad finger state on an opened virtual joystick.
Please note that values set here will not be applied until the next call to updateJoysticks, which can either be called directly, or can be called indirectly through various other SDL APIs, including, but not limited to the following: pollEvent, pumpEvents, waitEventTimeout, waitEvent.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
setJoystickVirtualAxis,setJoystickVirtualButton,setJoystickVirtualBall,setJoystickVirtualHat, SDL_SetJoystickVirtualSensorData
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetJoystickVirtualTouchpad. The safe flavor issetJoystickVirtualTouchpadSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetJoystickVirtualTouchpad, defined atSDL3/SDL_joystick.h 714:34
Since: 3.2.0
setJoystickVirtualTouchpadSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> Int32 |
|
| -> Bool |
|
| -> Float |
|
| -> Float |
|
| -> Float |
|
| -> IO Bool |
Set touchpad finger state on an opened virtual joystick.
Please note that values set here will not be applied until the next call to updateJoysticks, which can either be called directly, or can be called indirectly through various other SDL APIs, including, but not limited to the following: pollEvent, pumpEvents, waitEventTimeout, waitEvent.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
setJoystickVirtualAxis,setJoystickVirtualButton,setJoystickVirtualBall,setJoystickVirtualHat, SDL_SetJoystickVirtualSensorData
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetJoystickVirtualTouchpad. The unsafe flavor issetJoystickVirtualTouchpad. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetJoystickVirtualTouchpad, defined atSDL3/SDL_joystick.h 714:34
Since: 3.2.0
sendJoystickVirtualSensorData Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> SDL_SensorType |
|
| -> Word64 |
|
| -> PtrConst CFloat |
|
| -> Int32 |
|
| -> IO Bool |
Send a sensor update for an opened virtual joystick.
Please note that values set here will not be applied until the next call to updateJoysticks, which can either be called directly, or can be called indirectly through various other SDL APIs, including, but not limited to the following: pollEvent, pumpEvents, waitEventTimeout, waitEvent.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
setJoystickVirtualAxis,setJoystickVirtualButton,setJoystickVirtualBall,setJoystickVirtualHat,setJoystickVirtualTouchpad
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SendJoystickVirtualSensorData. The safe flavor issendJoystickVirtualSensorDataSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SendJoystickVirtualSensorData, defined atSDL3/SDL_joystick.h 744:34
Since: 3.2.0
sendJoystickVirtualSensorDataSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> SDL_SensorType |
|
| -> Word64 |
|
| -> PtrConst CFloat |
|
| -> Int32 |
|
| -> IO Bool |
Send a sensor update for an opened virtual joystick.
Please note that values set here will not be applied until the next call to updateJoysticks, which can either be called directly, or can be called indirectly through various other SDL APIs, including, but not limited to the following: pollEvent, pumpEvents, waitEventTimeout, waitEvent.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
setJoystickVirtualAxis,setJoystickVirtualButton,setJoystickVirtualBall,setJoystickVirtualHat,setJoystickVirtualTouchpad
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SendJoystickVirtualSensorData. The unsafe flavor issendJoystickVirtualSensorData. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SendJoystickVirtualSensorData, defined atSDL3/SDL_joystick.h 744:34
Since: 3.2.0
getJoystickProperties Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO SDL_PropertiesID |
Get the properties associated with a joystick.
The following read-only properties are provided by SDL:
: true if this joystick has an LED that has adjustable brightnesssDL_PROP_JOYSTICK_CAP_MONO_LED_BOOLEAN: true if this joystick has an LED that has adjustable colorsDL_PROP_JOYSTICK_CAP_RGB_LED_BOOLEAN: true if this joystick has a player LEDsDL_PROP_JOYSTICK_CAP_PLAYER_LED_BOOLEAN: true if this joystick has left/right rumblesDL_PROP_JOYSTICK_CAP_RUMBLE_BOOLEAN: true if this joystick has simple trigger rumblesDL_PROP_JOYSTICK_CAP_TRIGGER_RUMBLE_BOOLEAN
- Returns
- a valid property ID on success or 0 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickProperties. The safe flavor isgetJoystickPropertiesSafe. - C declaration
SDL_GetJoystickProperties, defined atSDL3/SDL_joystick.h 770:46
Since: 3.2.0
getJoystickPropertiesSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO SDL_PropertiesID |
Get the properties associated with a joystick.
The following read-only properties are provided by SDL:
: true if this joystick has an LED that has adjustable brightnesssDL_PROP_JOYSTICK_CAP_MONO_LED_BOOLEAN: true if this joystick has an LED that has adjustable colorsDL_PROP_JOYSTICK_CAP_RGB_LED_BOOLEAN: true if this joystick has a player LEDsDL_PROP_JOYSTICK_CAP_PLAYER_LED_BOOLEAN: true if this joystick has left/right rumblesDL_PROP_JOYSTICK_CAP_RUMBLE_BOOLEAN: true if this joystick has simple trigger rumblesDL_PROP_JOYSTICK_CAP_TRIGGER_RUMBLE_BOOLEAN
- Returns
- a valid property ID on success or 0 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickProperties. The unsafe flavor isgetJoystickProperties. - C declaration
SDL_GetJoystickProperties, defined atSDL3/SDL_joystick.h 770:46
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO (PtrConst CChar) |
Get the implementation dependent name of a joystick.
- Returns
- the name of the selected joystick. If no name can be found, this function returns NULL; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickNameForID
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickName. The safe flavor isgetJoystickNameSafe. - C declaration
SDL_GetJoystickName, defined atSDL3/SDL_joystick.h 791:42
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO (PtrConst CChar) |
Get the implementation dependent name of a joystick.
- Returns
- the name of the selected joystick. If no name can be found, this function returns NULL; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickNameForID
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickName. The unsafe flavor isgetJoystickName. - C declaration
SDL_GetJoystickName, defined atSDL3/SDL_joystick.h 791:42
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO (PtrConst CChar) |
Get the implementation dependent path of a joystick.
- Returns
- the path of the selected joystick. If no path can be found, this function returns NULL; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickPathForID
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickPath. The safe flavor isgetJoystickPathSafe. - C declaration
SDL_GetJoystickPath, defined atSDL3/SDL_joystick.h 806:42
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO (PtrConst CChar) |
Get the implementation dependent path of a joystick.
- Returns
- the path of the selected joystick. If no path can be found, this function returns NULL; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickPathForID
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickPath. The unsafe flavor isgetJoystickPath. - C declaration
SDL_GetJoystickPath, defined atSDL3/SDL_joystick.h 806:42
Since: 3.2.0
getJoystickPlayerIndex Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Int32 |
Get the player index of an opened joystick.
For XInput controllers this returns the XInput user index. Many joysticks will not be able to supply this information.
- Returns
- the player index, or -1 if it's not available.
- Thread safety
- It is safe to call this function from any thread.
- See also
setJoystickPlayerIndex
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickPlayerIndex. The safe flavor isgetJoystickPlayerIndexSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickPlayerIndex, defined atSDL3/SDL_joystick.h 823:33
Since: 3.2.0
getJoystickPlayerIndexSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Int32 |
Get the player index of an opened joystick.
For XInput controllers this returns the XInput user index. Many joysticks will not be able to supply this information.
- Returns
- the player index, or -1 if it's not available.
- Thread safety
- It is safe to call this function from any thread.
- See also
setJoystickPlayerIndex
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickPlayerIndex. The unsafe flavor isgetJoystickPlayerIndex. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickPlayerIndex, defined atSDL3/SDL_joystick.h 823:33
Since: 3.2.0
setJoystickPlayerIndex Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> IO Bool |
Set the player index of an opened joystick.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickPlayerIndex
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetJoystickPlayerIndex. The safe flavor issetJoystickPlayerIndexSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetJoystickPlayerIndex, defined atSDL3/SDL_joystick.h 840:34
Since: 3.2.0
setJoystickPlayerIndexSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> IO Bool |
Set the player index of an opened joystick.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickPlayerIndex
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetJoystickPlayerIndex. The unsafe flavor issetJoystickPlayerIndex. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetJoystickPlayerIndex, defined atSDL3/SDL_joystick.h 840:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO SDL_GUID |
Get the implementation-dependent GUID for the joystick.
This function requires an open joystick.
- Returns
- the GUID of the given joystick. If called on an invalid index, this function returns a zero GUID; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickGUIDForID,guidToString
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickGUID. The safe flavor isgetJoystickGUIDSafe. - C declaration
SDL_GetJoystickGUID, defined atSDL3/SDL_joystick.h 859:38
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO SDL_GUID |
Get the implementation-dependent GUID for the joystick.
This function requires an open joystick.
- Returns
- the GUID of the given joystick. If called on an invalid index, this function returns a zero GUID; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickGUIDForID,guidToString
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickGUID. The unsafe flavor isgetJoystickGUID. - C declaration
SDL_GetJoystickGUID, defined atSDL3/SDL_joystick.h 859:38
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Word16 |
Get the USB vendor ID of an opened joystick, if available.
If the vendor ID isn't available this function returns 0.
- Returns
- the USB vendor ID of the selected joystick, or 0 if unavailable.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickVendorForID
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickVendor. The safe flavor isgetJoystickVendorSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickVendor, defined atSDL3/SDL_joystick.h 875:36
Since: 3.2.0
getJoystickVendorSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Word16 |
Get the USB vendor ID of an opened joystick, if available.
If the vendor ID isn't available this function returns 0.
- Returns
- the USB vendor ID of the selected joystick, or 0 if unavailable.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickVendorForID
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickVendor. The unsafe flavor isgetJoystickVendor. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickVendor, defined atSDL3/SDL_joystick.h 875:36
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Word16 |
Get the USB product ID of an opened joystick, if available.
If the product ID isn't available this function returns 0.
- Returns
- the USB product ID of the selected joystick, or 0 if unavailable.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickProductForID
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickProduct. The safe flavor isgetJoystickProductSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickProduct, defined atSDL3/SDL_joystick.h 891:36
Since: 3.2.0
getJoystickProductSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Word16 |
Get the USB product ID of an opened joystick, if available.
If the product ID isn't available this function returns 0.
- Returns
- the USB product ID of the selected joystick, or 0 if unavailable.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickProductForID
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickProduct. The unsafe flavor isgetJoystickProduct. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickProduct, defined atSDL3/SDL_joystick.h 891:36
Since: 3.2.0
getJoystickProductVersion Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Word16 |
Get the product version of an opened joystick, if available.
If the product version isn't available this function returns 0.
- Returns
- the product version of the selected joystick, or 0 if unavailable.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickProductVersionForID
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickProductVersion. The safe flavor isgetJoystickProductVersionSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickProductVersion, defined atSDL3/SDL_joystick.h 907:36
Since: 3.2.0
getJoystickProductVersionSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Word16 |
Get the product version of an opened joystick, if available.
If the product version isn't available this function returns 0.
- Returns
- the product version of the selected joystick, or 0 if unavailable.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickProductVersionForID
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickProductVersion. The unsafe flavor isgetJoystickProductVersion. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickProductVersion, defined atSDL3/SDL_joystick.h 907:36
Since: 3.2.0
getJoystickFirmwareVersion Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Word16 |
Get the firmware version of an opened joystick, if available.
If the firmware version isn't available this function returns 0.
- Returns
- the firmware version of the selected joystick, or 0 if unavailable.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickFirmwareVersion. The safe flavor isgetJoystickFirmwareVersionSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickFirmwareVersion, defined atSDL3/SDL_joystick.h 922:36
Since: 3.2.0
getJoystickFirmwareVersionSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Word16 |
Get the firmware version of an opened joystick, if available.
If the firmware version isn't available this function returns 0.
- Returns
- the firmware version of the selected joystick, or 0 if unavailable.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickFirmwareVersion. The unsafe flavor isgetJoystickFirmwareVersion. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickFirmwareVersion, defined atSDL3/SDL_joystick.h 922:36
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO (PtrConst CChar) |
Get the serial number of an opened joystick, if available.
Returns the serial number of the joystick, or NULL if it is not available.
- Returns
- the serial number of the selected joystick, or NULL if unavailable.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickSerial. The safe flavor isgetJoystickSerialSafe. - C declaration
SDL_GetJoystickSerial, defined atSDL3/SDL_joystick.h 937:42
Since: 3.2.0
getJoystickSerialSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO (PtrConst CChar) |
Get the serial number of an opened joystick, if available.
Returns the serial number of the joystick, or NULL if it is not available.
- Returns
- the serial number of the selected joystick, or NULL if unavailable.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickSerial. The unsafe flavor isgetJoystickSerial. - C declaration
SDL_GetJoystickSerial, defined atSDL3/SDL_joystick.h 937:42
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO SDL_JoystickType |
Get the type of an opened joystick.
- Returns
- the
SDL_JoystickTypeof the selected joystick. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickTypeForID
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickType. The safe flavor isgetJoystickTypeSafe. - C declaration
SDL_GetJoystickType, defined atSDL3/SDL_joystick.h 951:46
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO SDL_JoystickType |
Get the type of an opened joystick.
- Returns
- the
SDL_JoystickTypeof the selected joystick. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickTypeForID
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickType. The unsafe flavor isgetJoystickType. - C declaration
SDL_GetJoystickType, defined atSDL3/SDL_joystick.h 951:46
Since: 3.2.0
Arguments
| :: SDL_GUID |
|
| -> Ptr Uint16 |
|
| -> Ptr Uint16 |
|
| -> Ptr Uint16 |
|
| -> Ptr Uint16 |
|
| -> IO () |
Get the device information encoded in a SDL_GUID structure.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickGUIDForID
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickGUIDInfo. The safe flavor isgetJoystickGUIDInfoSafe. - C declaration
SDL_GetJoystickGUIDInfo, defined atSDL3/SDL_joystick.h 972:34
Since: 3.2.0
getJoystickGUIDInfoSafe Source #
Arguments
| :: SDL_GUID |
|
| -> Ptr Uint16 |
|
| -> Ptr Uint16 |
|
| -> Ptr Uint16 |
|
| -> Ptr Uint16 |
|
| -> IO () |
Get the device information encoded in a SDL_GUID structure.
- Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickGUIDForID
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickGUIDInfo. The unsafe flavor isgetJoystickGUIDInfo. - C declaration
SDL_GetJoystickGUIDInfo, defined atSDL3/SDL_joystick.h 972:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Bool |
Get the status of a specified joystick.
- Returns
- true if the joystick has been opened, false if it has not; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_JoystickConnected. The safe flavor isjoystickConnectedSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_JoystickConnected, defined atSDL3/SDL_joystick.h 985:34
Since: 3.2.0
joystickConnectedSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Bool |
Get the status of a specified joystick.
- Returns
- true if the joystick has been opened, false if it has not; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_JoystickConnected. The unsafe flavor isjoystickConnected. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_JoystickConnected, defined atSDL3/SDL_joystick.h 985:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO SDL_JoystickID |
Get the instance ID of an opened joystick.
- Returns
- the instance ID of the specified joystick on success or 0 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickID. The safe flavor isgetJoystickIDSafe. - C declaration
SDL_GetJoystickID, defined atSDL3/SDL_joystick.h 998:44
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO SDL_JoystickID |
Get the instance ID of an opened joystick.
- Returns
- the instance ID of the specified joystick on success or 0 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickID. The unsafe flavor isgetJoystickID. - C declaration
SDL_GetJoystickID, defined atSDL3/SDL_joystick.h 998:44
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Int32 |
Get the number of general axis controls on a joystick.
Often, the directional pad on a game controller will either look like 4 separate buttons or a POV hat, and not axes, but all of this is up to the device and platform.
- Returns
- the number of axis controls/number of axes on success or -1 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickAxis,getNumJoystickBalls,getNumJoystickButtons,getNumJoystickHats
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetNumJoystickAxes. The safe flavor isgetNumJoystickAxesSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetNumJoystickAxes, defined atSDL3/SDL_joystick.h 1020:33
Since: 3.2.0
getNumJoystickAxesSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Int32 |
Get the number of general axis controls on a joystick.
Often, the directional pad on a game controller will either look like 4 separate buttons or a POV hat, and not axes, but all of this is up to the device and platform.
- Returns
- the number of axis controls/number of axes on success or -1 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickAxis,getNumJoystickBalls,getNumJoystickButtons,getNumJoystickHats
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetNumJoystickAxes. The unsafe flavor isgetNumJoystickAxes. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetNumJoystickAxes, defined atSDL3/SDL_joystick.h 1020:33
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Int32 |
Get the number of trackballs on a joystick.
Joystick trackballs have only relative motion events associated with them and their state cannot be polled.
Most joysticks do not have trackballs.
- Returns
- the number of trackballs on success or -1 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickBall,getNumJoystickAxes,getNumJoystickButtons,getNumJoystickHats
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetNumJoystickBalls. The safe flavor isgetNumJoystickBallsSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetNumJoystickBalls, defined atSDL3/SDL_joystick.h 1043:33
Since: 3.2.0
getNumJoystickBallsSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Int32 |
Get the number of trackballs on a joystick.
Joystick trackballs have only relative motion events associated with them and their state cannot be polled.
Most joysticks do not have trackballs.
- Returns
- the number of trackballs on success or -1 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickBall,getNumJoystickAxes,getNumJoystickButtons,getNumJoystickHats
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetNumJoystickBalls. The unsafe flavor isgetNumJoystickBalls. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetNumJoystickBalls, defined atSDL3/SDL_joystick.h 1043:33
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Int32 |
Get the number of POV hats on a joystick.
- Returns
- the number of POV hats on success or -1 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickHat,getNumJoystickAxes,getNumJoystickBalls,getNumJoystickButtons
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetNumJoystickHats. The safe flavor isgetNumJoystickHatsSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetNumJoystickHats, defined atSDL3/SDL_joystick.h 1061:33
Since: 3.2.0
getNumJoystickHatsSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Int32 |
Get the number of POV hats on a joystick.
- Returns
- the number of POV hats on success or -1 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickHat,getNumJoystickAxes,getNumJoystickBalls,getNumJoystickButtons
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetNumJoystickHats. The unsafe flavor isgetNumJoystickHats. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetNumJoystickHats, defined atSDL3/SDL_joystick.h 1061:33
Since: 3.2.0
getNumJoystickButtons Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Int32 |
Get the number of buttons on a joystick.
- Returns
- the number of buttons on success or -1 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickButton,getNumJoystickAxes,getNumJoystickBalls,getNumJoystickHats
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetNumJoystickButtons. The safe flavor isgetNumJoystickButtonsSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetNumJoystickButtons, defined atSDL3/SDL_joystick.h 1079:33
Since: 3.2.0
getNumJoystickButtonsSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO Int32 |
Get the number of buttons on a joystick.
- Returns
- the number of buttons on success or -1 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getJoystickButton,getNumJoystickAxes,getNumJoystickBalls,getNumJoystickHats
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetNumJoystickButtons. The unsafe flavor isgetNumJoystickButtons. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetNumJoystickButtons, defined atSDL3/SDL_joystick.h 1079:33
Since: 3.2.0
setJoystickEventsEnabled Source #
Set the state of joystick event processing.
If joystick events are disabled, you must call yourself and check the state of the joystick when you want joystick information.updateJoysticks
- Thread safety
- It is safe to call this function from any thread.
- See also
joystickEventsEnabled,updateJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetJoystickEventsEnabled. The safe flavor issetJoystickEventsEnabledSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetJoystickEventsEnabled, defined atSDL3/SDL_joystick.h 1097:34
Since: 3.2.0
setJoystickEventsEnabledSafe Source #
Set the state of joystick event processing.
If joystick events are disabled, you must call yourself and check the state of the joystick when you want joystick information.updateJoysticks
- Thread safety
- It is safe to call this function from any thread.
- See also
joystickEventsEnabled,updateJoysticks
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetJoystickEventsEnabled. The unsafe flavor issetJoystickEventsEnabled. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetJoystickEventsEnabled, defined atSDL3/SDL_joystick.h 1097:34
Since: 3.2.0
joystickEventsEnabled :: IO Bool Source #
Query the state of joystick event processing.
If joystick events are disabled, you must call yourself and check the state of the joystick when you want joystick information.updateJoysticks
- Returns
- true if joystick events are being processed, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
- See also
setJoystickEventsEnabled
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_JoystickEventsEnabled. The safe flavor isjoystickEventsEnabledSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_JoystickEventsEnabled, defined atSDL3/SDL_joystick.h 1114:34
Since: 3.2.0
joystickEventsEnabledSafe :: IO Bool Source #
Query the state of joystick event processing.
If joystick events are disabled, you must call yourself and check the state of the joystick when you want joystick information.updateJoysticks
- Returns
- true if joystick events are being processed, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
- See also
setJoystickEventsEnabled
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_JoystickEventsEnabled. The unsafe flavor isjoystickEventsEnabled. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_JoystickEventsEnabled, defined atSDL3/SDL_joystick.h 1114:34
Since: 3.2.0
updateJoysticks :: IO () Source #
Update the current state of the open joysticks.
This is called automatically by the event loop if any joystick events are enabled.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_UpdateJoysticks. The safe flavor isupdateJoysticksSafe: virtual-device callbacks run synchronously. - C declaration
SDL_UpdateJoysticks, defined atSDL3/SDL_joystick.h 1126:34
Since: 3.2.0
updateJoysticksSafe :: IO () Source #
Update the current state of the open joysticks.
This is called automatically by the event loop if any joystick events are enabled.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_UpdateJoysticks. The unsafe flavor isupdateJoysticks: virtual-device callbacks run synchronously. - C declaration
SDL_UpdateJoysticks, defined atSDL3/SDL_joystick.h 1126:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> IO Int16 |
Get the current state of an axis control on a joystick.
SDL makes no promises about what part of the joystick any given axis refers to. Your game should have some sort of configuration UI to let users specify what each axis should be bound to. Alternately, SDL's higher-level Game Controller API makes a great effort to apply order to this lower-level interface, so you know that a specific axis is the "left thumb stick," etc.
The value returned by is a signed integer (-32768 to 32767) representing the current position of the axis. It may be necessary to impose certain tolerances on these values to account for jitter.getJoystickAxis
- Returns
- a 16-bit signed integer representing the current position of the axis or 0 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getNumJoystickAxes
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickAxis. The safe flavor isgetJoystickAxisSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickAxis, defined atSDL3/SDL_joystick.h 1152:36
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> IO Int16 |
Get the current state of an axis control on a joystick.
SDL makes no promises about what part of the joystick any given axis refers to. Your game should have some sort of configuration UI to let users specify what each axis should be bound to. Alternately, SDL's higher-level Game Controller API makes a great effort to apply order to this lower-level interface, so you know that a specific axis is the "left thumb stick," etc.
The value returned by is a signed integer (-32768 to 32767) representing the current position of the axis. It may be necessary to impose certain tolerances on these values to account for jitter.getJoystickAxis
- Returns
- a 16-bit signed integer representing the current position of the axis or 0 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getNumJoystickAxes
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickAxis. The unsafe flavor isgetJoystickAxis. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickAxis, defined atSDL3/SDL_joystick.h 1152:36
Since: 3.2.0
getJoystickAxisInitialState Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> Ptr Sint16 |
|
| -> IO Bool |
Get the initial state of an axis control on a joystick.
The state is a value ranging from -32768 to 32767.
The axis indices start at index 0.
- Returns
- true if this axis has any initial value, or false if not.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickAxisInitialState. The safe flavor isgetJoystickAxisInitialStateSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickAxisInitialState, defined atSDL3/SDL_joystick.h 1170:34
Since: 3.2.0
getJoystickAxisInitialStateSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> Ptr Sint16 |
|
| -> IO Bool |
Get the initial state of an axis control on a joystick.
The state is a value ranging from -32768 to 32767.
The axis indices start at index 0.
- Returns
- true if this axis has any initial value, or false if not.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickAxisInitialState. The unsafe flavor isgetJoystickAxisInitialState. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickAxisInitialState, defined atSDL3/SDL_joystick.h 1170:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> Ptr CInt |
|
| -> Ptr CInt |
|
| -> IO Bool |
Get the ball axis change since the last poll.
Trackballs can only return relative motion since the last call to , these motion deltas are placed into getJoystickBalldx and dy.
Most joysticks do not have trackballs.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getNumJoystickBalls
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickBall. The safe flavor isgetJoystickBallSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickBall, defined atSDL3/SDL_joystick.h 1193:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> Ptr CInt |
|
| -> Ptr CInt |
|
| -> IO Bool |
Get the ball axis change since the last poll.
Trackballs can only return relative motion since the last call to , these motion deltas are placed into getJoystickBalldx and dy.
Most joysticks do not have trackballs.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getNumJoystickBalls
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickBall. The unsafe flavor isgetJoystickBall. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickBall, defined atSDL3/SDL_joystick.h 1193:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> IO Word8 |
Get the current state of a POV hat on a joystick.
The returned value will be one of the SDL_HAT_* values.
- Returns
- the current hat position.
- Thread safety
- It is safe to call this function from any thread.
- See also
getNumJoystickHats
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickHat. The safe flavor isgetJoystickHatSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickHat, defined atSDL3/SDL_joystick.h 1210:35
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> IO Word8 |
Get the current state of a POV hat on a joystick.
The returned value will be one of the SDL_HAT_* values.
- Returns
- the current hat position.
- Thread safety
- It is safe to call this function from any thread.
- See also
getNumJoystickHats
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickHat. The unsafe flavor isgetJoystickHat. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickHat, defined atSDL3/SDL_joystick.h 1210:35
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> IO Bool |
Get the current state of a button on a joystick.
- Returns
- true if the button is pressed, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
- See also
getNumJoystickButtons
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickButton. The safe flavor isgetJoystickButtonSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickButton, defined atSDL3/SDL_joystick.h 1236:34
Since: 3.2.0
getJoystickButtonSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Int32 |
|
| -> IO Bool |
Get the current state of a button on a joystick.
- Returns
- true if the button is pressed, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
- See also
getNumJoystickButtons
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickButton. The unsafe flavor isgetJoystickButton. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetJoystickButton, defined atSDL3/SDL_joystick.h 1236:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> Word16 |
|
| -> Word16 |
|
| -> Word32 |
|
| -> IO Bool |
Start a rumble effect.
Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
This function requires you to process SDL events or call to update rumble state.updateJoysticks
- Returns
- true, or false if rumble isn't supported on this joystick.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_RumbleJoystick. The safe flavor isrumbleJoystickSafe: a virtual joystick's rumble callback runs synchronously. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_RumbleJoystick, defined atSDL3/SDL_joystick.h 1259:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> Word16 |
|
| -> Word16 |
|
| -> Word32 |
|
| -> IO Bool |
Start a rumble effect.
Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
This function requires you to process SDL events or call to update rumble state.updateJoysticks
- Returns
- true, or false if rumble isn't supported on this joystick.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_RumbleJoystick. The unsafe flavor isrumbleJoystick: a virtual joystick's rumble callback runs synchronously. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_RumbleJoystick, defined atSDL3/SDL_joystick.h 1259:34
Since: 3.2.0
rumbleJoystickTriggers Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Word16 |
|
| -> Word16 |
|
| -> Word32 |
|
| -> IO Bool |
Start a rumble effect in the joystick's triggers.
Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling.
Note that this is rumbling of the triggers and not the game controller as a whole. This is currently only supported on Xbox One controllers. If you want the (more common) whole-controller rumble, use instead.rumbleJoystick
This function requires you to process SDL events or call to update rumble state.updateJoysticks
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
rumbleJoystick
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_RumbleJoystickTriggers. The safe flavor isrumbleJoystickTriggersSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_RumbleJoystickTriggers, defined atSDL3/SDL_joystick.h 1290:34
Since: 3.2.0
rumbleJoystickTriggersSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Word16 |
|
| -> Word16 |
|
| -> Word32 |
|
| -> IO Bool |
Start a rumble effect in the joystick's triggers.
Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling.
Note that this is rumbling of the triggers and not the game controller as a whole. This is currently only supported on Xbox One controllers. If you want the (more common) whole-controller rumble, use instead.rumbleJoystick
This function requires you to process SDL events or call to update rumble state.updateJoysticks
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
rumbleJoystick
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_RumbleJoystickTriggers. The unsafe flavor isrumbleJoystickTriggers. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_RumbleJoystickTriggers, defined atSDL3/SDL_joystick.h 1290:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> Word8 |
|
| -> Word8 |
|
| -> Word8 |
|
| -> IO Bool |
Update a joystick's LED color.
An example of a joystick LED is the light on the back of a PlayStation 4's DualShock 4 controller.
For joysticks with a single color LED, the maximum of the RGB values will be used as the LED brightness.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetJoystickLED. The safe flavor issetJoystickLEDSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetJoystickLED, defined atSDL3/SDL_joystick.h 1312:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> Word8 |
|
| -> Word8 |
|
| -> Word8 |
|
| -> IO Bool |
Update a joystick's LED color.
An example of a joystick LED is the light on the back of a PlayStation 4's DualShock 4 controller.
For joysticks with a single color LED, the maximum of the RGB values will be used as the LED brightness.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetJoystickLED. The unsafe flavor issetJoystickLED. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetJoystickLED, defined atSDL3/SDL_joystick.h 1312:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> PtrConst Void |
|
| -> Int32 |
|
| -> IO Bool |
Send a joystick specific effect packet.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SendJoystickEffect. The safe flavor issendJoystickEffectSafe: a virtual joystick's effect callback runs synchronously. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SendJoystickEffect, defined atSDL3/SDL_joystick.h 1327:34
Since: 3.2.0
sendJoystickEffectSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> PtrConst Void |
|
| -> Int32 |
|
| -> IO Bool |
Send a joystick specific effect packet.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SendJoystickEffect. The unsafe flavor issendJoystickEffect: a virtual joystick's effect callback runs synchronously. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SendJoystickEffect, defined atSDL3/SDL_joystick.h 1327:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO () |
Close a joystick previously opened with .openJoystick
- Thread safety
- It is safe to call this function from any thread.
- See also
openJoystick
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_CloseJoystick. The safe flavor iscloseJoystickSafe. - C declaration
SDL_CloseJoystick, defined atSDL3/SDL_joystick.h 1340:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO () |
Close a joystick previously opened with .openJoystick
- Thread safety
- It is safe to call this function from any thread.
- See also
openJoystick
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_CloseJoystick. The unsafe flavor iscloseJoystick. - C declaration
SDL_CloseJoystick, defined atSDL3/SDL_joystick.h 1340:34
Since: 3.2.0
getJoystickConnectionState Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO SDL_JoystickConnectionState |
Get the connection state of a joystick.
- Returns
- the connection state on success or
SDL_JOYSTICK_CONNECTION_INVALIDon failure; callgetErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickConnectionState. The safe flavor isgetJoystickConnectionStateSafe. - C declaration
SDL_GetJoystickConnectionState, defined atSDL3/SDL_joystick.h 1354:57
Since: 3.2.0
getJoystickConnectionStateSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO SDL_JoystickConnectionState |
Get the connection state of a joystick.
- Returns
- the connection state on success or
SDL_JOYSTICK_CONNECTION_INVALIDon failure; callgetErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickConnectionState. The unsafe flavor isgetJoystickConnectionState. - C declaration
SDL_GetJoystickConnectionState, defined atSDL3/SDL_joystick.h 1354:57
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> Ptr CInt |
|
| -> IO SDL_PowerState |
Get the battery state of a joystick.
You should never take a battery status as absolute truth. Batteries (especially failing batteries) are delicate hardware, and the values reported here are best estimates based on what that hardware reports. It's not uncommon for older batteries to lose stored power much faster than it reports, or completely drain when reporting it has 20 percent left, etc.
- Returns
- the current battery state or
SDL_POWERSTATE_ERRORon failure; callgetErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetJoystickPowerInfo. The safe flavor isgetJoystickPowerInfoSafe. - C declaration
SDL_GetJoystickPowerInfo, defined atSDL3/SDL_joystick.h 1377:44
Since: 3.2.0
getJoystickPowerInfoSafe Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> Ptr CInt |
|
| -> IO SDL_PowerState |
Get the battery state of a joystick.
You should never take a battery status as absolute truth. Batteries (especially failing batteries) are delicate hardware, and the values reported here are best estimates based on what that hardware reports. It's not uncommon for older batteries to lose stored power much faster than it reports, or completely drain when reporting it has 20 percent left, etc.
- Returns
- the current battery state or
SDL_POWERSTATE_ERRORon failure; callgetErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetJoystickPowerInfo. The unsafe flavor isgetJoystickPowerInfo. - C declaration
SDL_GetJoystickPowerInfo, defined atSDL3/SDL_joystick.h 1377:44
Since: 3.2.0