HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Modulesdl2-2.5.6.1Haskell2010

SDL.Input.Joystick

Synopsis
  • Packagesdl2-2.5.6.1
  • 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, …

Identifies whether a joystick has been connected or disconnected.

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