HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulesdl2-2.5.5.0Haskell2010

SDL.Input.Joystick

  • 5 types
  • 13 values
  • Packagesdl2-2.5.5.0
  • Exports18
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceJoystick.hs
datadata JoystickDevice
#

A description of joystick that can be opened using openJoystick. To retrieve a list of connected joysticks, use availableJoysticks.

Instances6Eq, Ord, Read, Show, Generic, Rep
newtypenewtype Joystick
#
Instances6Eq, Data, Ord, Show, Generic, Rep
datadata JoyButtonState
#

Identifies the state of a joystick button.

Instances8Eq, Data, Ord, Read, Show, Generic, …
valueaxisPosition :: MonadIO m => Joystick -> CInt -> m Int16
#

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.

datadata JoyHatPosition
#

Identifies the state of the POV hat on a joystick.

Constructors

Instances8Eq, Data, Ord, Read, Show, Generic, …
datadata JoyDeviceConnection
#

Identifies whether a joystick has been connected or disconnected.

Instances8Eq, Data, Ord, Read, Show, Generic, …