Count the number of joysticks attached to the system.
See SDL_NumJoysticks for C documentation.
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27
Modulesdl2-2.5.5.0Haskell2010
Count the number of joysticks attached to the system.
See SDL_NumJoysticks for C documentation.
Enumerate all connected joysticks, retrieving a description of each.
A description of joystick that can be opened using openJoystick. To retrieve a list of connected joysticks, use availableJoysticks.
Eq JoystickDeviceDefined in sdl2-2.5.5.0 · SDL.Input.JoystickOrd JoystickDeviceDefined in sdl2-2.5.5.0 · SDL.Input.JoystickRead JoystickDeviceDefined in sdl2-2.5.5.0 · SDL.Input.JoystickShow JoystickDeviceDefined in sdl2-2.5.5.0 · SDL.Input.JoystickGeneric JoystickDeviceDefined in sdl2-2.5.5.0 · SDL.Input.Joysticktype Rep JoystickDevice = D1 ('MetaData "JoystickDevice"
"SDL.Input.Joystick"
"sdl2-2.5.5.0-3sH3mgPhw4837qWuaPOiH"
'False) (C1 ('MetaCons "JoystickDevice"
'PrefixI 'True) (S1 ('MetaSel ('Just "joystickDeviceName"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "joystickDeviceId"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt)))Defined in sdl2-2.5.5.0 · SDL.Input.JoystickopenJoystick :: (Functor m, MonadIO m)=> JoystickDeviceThe device to open. Use availableJoysticks to find JoystickDevicess
-> m JoystickOpen a joystick so that you can start receiving events from interaction with this joystick.
See SDL_JoystickOpen for C documentation.
Close a joystick previously opened with openJoystick.
See SDL_JoystickClose for C documentation.
Get the instance ID of an opened joystick. The instance ID is used to identify the joystick in future SDL events.
See SDL_JoystickInstanceID for C documentation.
Eq JoystickDefined in sdl2-2.5.5.0 · SDL.Internal.TypesData JoystickDefined in sdl2-2.5.5.0 · SDL.Internal.TypesOrd JoystickDefined in sdl2-2.5.5.0 · SDL.Internal.TypesShow JoystickDefined in sdl2-2.5.5.0 · SDL.Internal.TypesGeneric JoystickDefined in sdl2-2.5.5.0 · SDL.Internal.Typestype Rep Joystick = D1 ('MetaData "Joystick"
"SDL.Internal.Types"
"sdl2-2.5.5.0-3sH3mgPhw4837qWuaPOiH"
'True) (C1 ('MetaCons "Joystick"
'PrefixI 'True) (S1 ('MetaSel ('Just "joystickPtr"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Joystick)))Defined in sdl2-2.5.5.0 · SDL.Internal.TypesIdentifies the state of a joystick button.
Eq JoyButtonStateDefined in sdl2-2.5.5.0 · SDL.Input.JoystickData JoyButtonStateDefined in sdl2-2.5.5.0 · SDL.Input.JoystickOrd JoyButtonStateDefined in sdl2-2.5.5.0 · SDL.Input.JoystickRead JoyButtonStateDefined in sdl2-2.5.5.0 · SDL.Input.JoystickShow JoyButtonStateDefined in sdl2-2.5.5.0 · SDL.Input.JoystickGeneric JoyButtonStateDefined in sdl2-2.5.5.0 · SDL.Input.JoystickFromNumber JoyButtonState Word8Defined in sdl2-2.5.5.0 · SDL.Input.Joysticktype Rep JoyButtonState = D1 ('MetaData "JoyButtonState"
"SDL.Input.Joystick"
"sdl2-2.5.5.0-3sH3mgPhw4837qWuaPOiH"
'False) (C1 ('MetaCons "JoyButtonPressed"
'PrefixI 'False) U1 :+: C1 ('MetaCons "JoyButtonReleased"
'PrefixI 'False) U1)Defined in sdl2-2.5.5.0 · SDL.Input.JoystickbuttonPressed Determine if a given button is currently held.
See SDL_JoystickGetButton for C documentation.
ballDelta Get the ball axis change since the last poll.
See SDL_JoystickGetBall for C documentation.
Get the current state of an axis control on a joystick.
Returns a 16-bit signed integer representing the current position of the axis. The state is a value ranging from -32768 to 32767.
On most modern joysticks the x-axis is usually represented by axis 0 and the y-axis by axis 1. The value returned by axisPosition 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.
Some joysticks use axes 2 and 3 for extra buttons.
See SDL_JoystickGetAxis for C documentation.
Get the number of general axis controls on a joystick.
See SDL_JoystickNumAxes for C documentation.
Get the number of buttons on a joystick.
See SDL_JoystickNumButtons for C documentation.
Get the number of trackballs on a joystick.
See SDL_JoystickNumBalls for C documentation.
Identifies the state of the POV hat on a joystick.
HatCenteredCentered position
HatUpUp position
HatRightRight position
HatDownDown position
HatLeftLeft position
HatRightUpRight-up position
HatRightDownRight-down position
HatLeftUpLeft-up position
HatLeftDownLeft-down position
Eq JoyHatPositionDefined in sdl2-2.5.5.0 · SDL.Input.JoystickData JoyHatPositionDefined in sdl2-2.5.5.0 · SDL.Input.JoystickOrd JoyHatPositionDefined in sdl2-2.5.5.0 · SDL.Input.JoystickRead JoyHatPositionDefined in sdl2-2.5.5.0 · SDL.Input.JoystickShow JoyHatPositionDefined in sdl2-2.5.5.0 · SDL.Input.JoystickGeneric JoyHatPositionDefined in sdl2-2.5.5.0 · SDL.Input.JoystickFromNumber JoyHatPosition Word8Defined in sdl2-2.5.5.0 · SDL.Input.Joysticktype Rep JoyHatPosition = D1 ('MetaData "JoyHatPosition"
"SDL.Input.Joystick"
"sdl2-2.5.5.0-3sH3mgPhw4837qWuaPOiH"
'False) (((C1 ('MetaCons "HatCentered"
'PrefixI 'False) U1 :+: C1 ('MetaCons "HatUp"
'PrefixI 'False) U1) :+: (C1 ('MetaCons "HatRight"
'PrefixI 'False) U1 :+: C1 ('MetaCons "HatDown"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons "HatLeft"
'PrefixI 'False) U1 :+: C1 ('MetaCons "HatRightUp"
'PrefixI 'False) U1) :+: (C1 ('MetaCons "HatRightDown"
'PrefixI 'False) U1 :+: (C1 ('MetaCons "HatLeftUp"
'PrefixI 'False) U1 :+: C1 ('MetaCons "HatLeftDown"
'PrefixI 'False) U1))))Defined in sdl2-2.5.5.0 · SDL.Input.JoystickgetHat Get current position of a POV hat on a joystick.
See SDL_JoystickGetHat for C documentation.
Get the number of POV hats on a joystick.
See SDL_JoystickNumHats for C documentation.
Identifies whether a joystick has been connected or disconnected.
Eq JoyDeviceConnectionDefined in sdl2-2.5.5.0 · SDL.Input.JoystickData JoyDeviceConnectionDefined in sdl2-2.5.5.0 · SDL.Input.JoystickOrd JoyDeviceConnectionDefined in sdl2-2.5.5.0 · SDL.Input.JoystickRead JoyDeviceConnectionDefined in sdl2-2.5.5.0 · SDL.Input.JoystickShow JoyDeviceConnectionDefined in sdl2-2.5.5.0 · SDL.Input.JoystickGeneric JoyDeviceConnectionDefined in sdl2-2.5.5.0 · SDL.Input.JoystickFromNumber JoyDeviceConnection Word32Defined in sdl2-2.5.5.0 · SDL.Input.Joysticktype Rep JoyDeviceConnection = D1 ('MetaData "JoyDeviceConnection"
"SDL.Input.Joystick"
"sdl2-2.5.5.0-3sH3mgPhw4837qWuaPOiH"
'False) (C1 ('MetaCons "JoyDeviceAdded"
'PrefixI 'False) U1 :+: C1 ('MetaCons "JoyDeviceRemoved"
'PrefixI 'False) U1)Defined in sdl2-2.5.5.0 · SDL.Input.Joystick