SFML-2.3.2: SFML bindings

Safe HaskellSafe-Inferred
LanguageHaskell98

SFML.Window.Joystick

Synopsis

Documentation

data JoystickCap Source

Global joysticks capabilities

Constructors

JoystickCount

Maximum number of supported joysticks

JoystickButtonCount

Maximum number of supported buttons

JoystickAxisCount

Maximum number of supported axes

data JoystickAxis Source

Axes supported by SFML joysticks

Constructors

JoystickX

The X axis

JoystickY

The Y axis

JoystickZ

The Z axis

JoystickR

The R axis

JoystickU

The U axis

JoystickV

The V axis

JoystickPovX

The X axis of the point-of-view hat

JoystickPovY

The Y axis of the point-of-view hat

isJoystickConnected Source

Arguments

:: Int

Index of the joystick to check

-> IO Bool 

Check if a joystick is connected.

getButtonCount Source

Arguments

:: Int

Index of the joystick

-> IO Int 

Return the number of buttons supported by a joystick.

If the joystick is not connected, this function returns 0.

hasAxis Source

Arguments

:: Int

Index of the joystick

-> Int

Axis to check

-> IO Bool 

Check if a joystick supports a given axis.

If the joystick is not connected, this function returns False.

isJoystickButtonPressed Source

Arguments

:: Int

Index of the joystick

-> Int

Button to check

-> IO Bool 

Check if a joystick button is pressed.

If the joystick is not connected, this function returns False.

getAxisPosition Source

Arguments

:: Int

Index of the joystick

-> Int

Axis to check

-> IO Float 

Get the current position of a joystick axis.

If the joystick is not connected, this function returns 0.

getJoystickIdentification Source

Arguments

:: Int

Index of the joystick

-> IO JoystickIdentification 

Get the joystick information.

The result of this function will only remain valid until the next time the function is called.

updateJoystick :: IO () Source

Update the states of all joysticks.

This function is used internally by SFML, so you normally don't have to call it explicitely. However, you may need to call it if you have no window yet (or no window at all): in this case the joysticks states are not updated automatically.