@@ -96,6 +96,7 @@ module SDL.Raw.Event (
9696 gameControllerClose ,
9797 gameControllerEventState ,
9898 gameControllerFromInstanceID ,
99+ gameControllerFromPlayerIndex ,
99100 gameControllerGetAttached ,
100101 gameControllerGetAxis ,
101102 gameControllerGetAxisFromString ,
@@ -104,6 +105,12 @@ module SDL.Raw.Event (
104105 gameControllerGetButton ,
105106 gameControllerGetButtonFromString ,
106107 gameControllerGetJoystick ,
108+ gameControllerGetNumTouchpadFingers ,
109+ gameControllerGetNumTouchpads ,
110+ gameControllerGetPlayerIndex ,
111+ gameControllerHasLED ,
112+ gameControllerHasRumble ,
113+ gameControllerHasRumbleTriggers ,
107114 gameControllerGetStringForAxis ,
108115 gameControllerGetStringForButton ,
109116 gameControllerMapping ,
@@ -113,6 +120,9 @@ module SDL.Raw.Event (
113120 gameControllerOpen ,
114121 gameControllerUpdate ,
115122 gameControllerRumble ,
123+ gameControllerRumbleTriggers ,
124+ gameControllerSetLED ,
125+ gameControllerSetPlayerIndex ,
116126 isGameController ,
117127 eventBuffer ,
118128 eventBufferSize
@@ -220,6 +230,7 @@ foreign import ccall "SDL.h SDL_GameControllerAddMappingsFromRW" gameControllerA
220230foreign import ccall " SDL.h SDL_GameControllerClose" gameControllerCloseFFI :: GameController -> IO ()
221231foreign import ccall " SDL.h SDL_GameControllerEventState" gameControllerEventStateFFI :: CInt -> IO CInt
222232foreign import ccall " SDL.h SDL_GameControllerFromInstanceID" gameControllerFromInstanceIDFFI :: JoystickID -> IO GameController
233+ foreign import ccall " SDL.h SDL_GameControllerFromPlayerIndex" gameControllerFromPlayerIndexFFI :: CInt -> IO GameController
223234foreign import ccall " SDL.h SDL_GameControllerGetAttached" gameControllerGetAttachedFFI :: GameController -> IO Bool
224235foreign import ccall " SDL.h SDL_GameControllerGetAxis" gameControllerGetAxisFFI :: GameController -> GameControllerAxis -> IO Int16
225236foreign import ccall " SDL.h SDL_GameControllerGetAxisFromString" gameControllerGetAxisFromStringFFI :: CString -> IO GameControllerAxis
@@ -228,6 +239,12 @@ foreign import ccall "sdlhelper.h SDLHelper_GameControllerGetBindForButton" game
228239foreign import ccall " SDL.h SDL_GameControllerGetButton" gameControllerGetButtonFFI :: GameController -> GameControllerButton -> IO Word8
229240foreign import ccall " SDL.h SDL_GameControllerGetButtonFromString" gameControllerGetButtonFromStringFFI :: CString -> IO GameControllerButton
230241foreign import ccall " SDL.h SDL_GameControllerGetJoystick" gameControllerGetJoystickFFI :: GameController -> IO Joystick
242+ foreign import ccall " SDL.h SDL_GameControllerGetNumTouchpadFingers" gameControllerGetNumTouchpadFingersFFI :: GameController -> CInt -> IO CInt
243+ foreign import ccall " SDL.h SDL_GameControllerGetNumTouchpads" gameControllerGetNumTouchpadsFFI :: GameController -> IO CInt
244+ foreign import ccall " SDL.h SDL_GameControllerGetPlayerIndex" gameControllerGetPlayerIndexFFI :: GameController -> IO CInt
245+ foreign import ccall " SDL.h SDL_GameControllerHasLED" gameControllerHasLEDFFI :: GameController -> IO Bool
246+ foreign import ccall " SDL.h SDL_GameControllerHasRumble" gameControllerHasRumbleFFI :: GameController -> IO Bool
247+ foreign import ccall " SDL.h SDL_GameControllerHasRumbleTriggers" gameControllerHasRumbleTriggersFFI :: GameController -> IO Bool
231248foreign import ccall " SDL.h SDL_GameControllerGetStringForAxis" gameControllerGetStringForAxisFFI :: GameControllerAxis -> IO CString
232249foreign import ccall " SDL.h SDL_GameControllerGetStringForButton" gameControllerGetStringForButtonFFI :: GameControllerButton -> IO CString
233250foreign import ccall " SDL.h SDL_GameControllerMapping" gameControllerMappingFFI :: GameController -> IO CString
@@ -237,6 +254,9 @@ foreign import ccall "SDL.h SDL_GameControllerNameForIndex" gameControllerNameFo
237254foreign import ccall " SDL.h SDL_GameControllerOpen" gameControllerOpenFFI :: CInt -> IO GameController
238255foreign import ccall " SDL.h SDL_GameControllerUpdate" gameControllerUpdateFFI :: IO ()
239256foreign import ccall " SDL.h SDL_GameControllerRumble" gameControllerRumbleFFI :: GameController -> CUShort -> CUShort -> CUInt -> IO CInt
257+ foreign import ccall " SDL.h SDL_GameControllerRumbleTriggers" gameControllerRumbleTriggersFFI :: GameController -> CUShort -> CUShort -> CUInt -> IO CInt
258+ foreign import ccall " SDL.h SDL_GameControllerSetLED" gameControllerSetLEDFFI :: GameController -> Word8 -> Word8 -> Word8 -> IO CInt
259+ foreign import ccall " SDL.h SDL_GameControllerSetPlayerIndex" gameControllerSetPlayerIndexFFI :: GameController -> CInt -> IO ()
240260foreign import ccall " SDL.h SDL_IsGameController" isGameControllerFFI :: CInt -> IO Bool
241261
242262foreign import ccall " sdlhelper.c SDLHelper_GetEventBufferSize" eventBufferSize :: CInt
@@ -607,6 +627,10 @@ gameControllerFromInstanceID :: MonadIO m => JoystickID -> m GameController
607627gameControllerFromInstanceID v1 = liftIO $ gameControllerFromInstanceIDFFI v1
608628{-# INLINE gameControllerFromInstanceID #-}
609629
630+ gameControllerFromPlayerIndex :: MonadIO m => CInt -> m GameController
631+ gameControllerFromPlayerIndex v1 = liftIO $ gameControllerFromPlayerIndexFFI v1
632+ {-# INLINE gameControllerFromPlayerIndex #-}
633+
610634gameControllerGetAttached :: MonadIO m => GameController -> m Bool
611635gameControllerGetAttached v1 = liftIO $ gameControllerGetAttachedFFI v1
612636{-# INLINE gameControllerGetAttached #-}
@@ -643,6 +667,31 @@ gameControllerGetJoystick :: MonadIO m => GameController -> m Joystick
643667gameControllerGetJoystick v1 = liftIO $ gameControllerGetJoystickFFI v1
644668{-# INLINE gameControllerGetJoystick #-}
645669
670+ gameControllerGetNumTouchpadFingers :: MonadIO m => GameController -> CInt -> m CInt
671+ gameControllerGetNumTouchpadFingers gamecontroller touchpad =
672+ liftIO $ gameControllerGetNumTouchpadFingersFFI gamecontroller touchpad
673+ {-# INLINE gameControllerGetNumTouchpadFingers #-}
674+
675+ gameControllerGetNumTouchpads :: MonadIO m => GameController -> m CInt
676+ gameControllerGetNumTouchpads gamecontroller = liftIO $ gameControllerGetNumTouchpadsFFI gamecontroller
677+ {-# INLINE gameControllerGetNumTouchpads #-}
678+
679+ gameControllerGetPlayerIndex :: MonadIO m => GameController -> m CInt
680+ gameControllerGetPlayerIndex gamecontroller = liftIO $ gameControllerGetPlayerIndexFFI gamecontroller
681+ {-# INLINE gameControllerGetPlayerIndex #-}
682+
683+ gameControllerHasLED :: MonadIO m => GameController -> m Bool
684+ gameControllerHasLED gamecontroller = liftIO $ gameControllerHasLEDFFI gamecontroller
685+ {-# INLINE gameControllerHasLED #-}
686+
687+ gameControllerHasRumble :: MonadIO m => GameController -> m Bool
688+ gameControllerHasRumble gamecontroller = liftIO $ gameControllerHasRumbleFFI gamecontroller
689+ {-# INLINE gameControllerHasRumble #-}
690+
691+ gameControllerHasRumbleTriggers :: MonadIO m => GameController -> m Bool
692+ gameControllerHasRumbleTriggers gamecontroller = liftIO $ gameControllerHasRumbleTriggersFFI gamecontroller
693+ {-# INLINE gameControllerHasRumbleTriggers #-}
694+
646695gameControllerGetStringForAxis :: MonadIO m => GameControllerAxis -> m CString
647696gameControllerGetStringForAxis v1 = liftIO $ gameControllerGetStringForAxisFFI v1
648697{-# INLINE gameControllerGetStringForAxis #-}
@@ -681,6 +730,18 @@ gameControllerRumble :: MonadIO m => GameController -> CUShort -> CUShort -> CUI
681730gameControllerRumble v1 v2 v3 v4 = liftIO $ gameControllerRumbleFFI v1 v2 v3 v4
682731{-# INLINE gameControllerRumble #-}
683732
733+ gameControllerRumbleTriggers :: MonadIO m => GameController -> CUShort -> CUShort -> CUInt -> m CInt
734+ gameControllerRumbleTriggers gamecontroller v1 v2 v3 = liftIO $ gameControllerRumbleTriggersFFI gamecontroller v1 v2 v3
735+ {-# INLINE gameControllerRumbleTriggers #-}
736+
737+ gameControllerSetLED :: MonadIO m => GameController -> Word8 -> Word8 -> Word8 -> m CInt
738+ gameControllerSetLED gamecontroller v1 v2 v3 = liftIO $ gameControllerSetLEDFFI gamecontroller v1 v2 v3
739+ {-# INLINE gameControllerSetLED #-}
740+
741+ gameControllerSetPlayerIndex :: MonadIO m => GameController -> CInt -> m ()
742+ gameControllerSetPlayerIndex gamecontroller v1 = liftIO $ gameControllerSetPlayerIndexFFI gamecontroller v1
743+ {-# INLINE gameControllerSetPlayerIndex #-}
744+
684745isGameController :: MonadIO m => CInt -> m Bool
685746isGameController v1 = liftIO $ isGameControllerFFI v1
686747{-# INLINE isGameController #-}
0 commit comments