Joystick

Give access to the real-time state of the joysticks.

Members

Enums

Axis
enum Axis

Axes supported by SFML joysticks.

Static functions

getAxisPosition
float getAxisPosition(uint joystick, Axis axis)

Get the current position of a joystick axis. * If the joystick is not connected, this function returns 0. *

getButtonCount
uint getButtonCount(uint joystick)

Return the number of buttons supported by a joystick. * If the joystick is not connected, this function returns 0. *

getIdentification
Identification getIdentification(uint joystick)

Get the joystick information *

hasAxis
bool hasAxis(uint joystick, Axis axis)

Check if a joystick supports a given axis. * If the joystick is not connected, this function returns false. *

isButtonPressed
bool isButtonPressed(uint joystick, uint button)

Check if a joystick button is pressed. * If the joystick is not connected, this function returns false. *

isConnected
bool isConnected(uint joystick)

Check if a joystick is connected. *

update
void update()

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.

Structs

Identification
struct Identification

Structure holding a joystick's identification

Meta