Input.h File Reference

#include <SFML/Config.h>
#include <SFML/Window/Event.h>
#include <SFML/Window/Types.h>

Go to the source code of this file.


Functions

CSFML_API sfBool sfInput_IsKeyDown (sfInput *Input, sfKeyCode KeyCode)
 Get the state of a key.
CSFML_API sfBool sfInput_IsMouseButtonDown (sfInput *Input, sfMouseButton Button)
 Get the state of a mouse button.
CSFML_API sfBool sfInput_IsJoystickButtonDown (sfInput *Input, unsigned int JoyId, unsigned int Button)
 Get the state of a joystick button.
CSFML_API int sfInput_GetMouseX (sfInput *Input)
 Get the mouse X position.
CSFML_API int sfInput_GetMouseY (sfInput *Input)
 Get the mouse Y position.
CSFML_API float sfInput_GetJoystickAxis (sfInput *Input, unsigned int JoyId, sfJoyAxis Axis)
 Get the joystick position on a given axis.

Function Documentation

CSFML_API float sfInput_GetJoystickAxis ( sfInput Input,
unsigned int  JoyId,
sfJoyAxis  Axis 
)

Get the joystick position on a given axis.

Parameters:
Input : Input object
JoyId : Identifier of the joystick to check (0 or 1)
Axis : Identifier of the axis to read
Returns:
Current joystick position, in the range [-100, 100]

CSFML_API int sfInput_GetMouseX ( sfInput Input  ) 

Get the mouse X position.

Parameters:
Input : Input object
Returns:
Current mouse left position, relative to owner window

CSFML_API int sfInput_GetMouseY ( sfInput Input  ) 

Get the mouse Y position.

Parameters:
Input : Input object
Returns:
Current mouse top position, relative to owner window

CSFML_API sfBool sfInput_IsJoystickButtonDown ( sfInput Input,
unsigned int  JoyId,
unsigned int  Button 
)

Get the state of a joystick button.

Parameters:
Input : Input object
JoyId : Identifier of the joystick to check (0 or 1)
Button : Button to check
Returns:
sfTrue if button is down, sfFalse if button is up

CSFML_API sfBool sfInput_IsKeyDown ( sfInput Input,
sfKeyCode  KeyCode 
)

Get the state of a key.

Parameters:
Input : Input object
KeyCode : Key to check
Returns:
sfTrue if key is down, sfFalse if key is up

CSFML_API sfBool sfInput_IsMouseButtonDown ( sfInput Input,
sfMouseButton  Button 
)

Get the state of a mouse button.

Parameters:
Input : Input object
Button : Button to check
Returns:
sfTrue if button is down, sfFalse if button is up