Warning
This page refers to an old version of SFML. Click here to switch to the latest version.
Warning
This page refers to an old version of SFML. Click here to switch to the latest version.
Input handles real-time input from keyboard and mouse. More...
#include <SFML/Window/Input.hpp>
Public Member Functions | |
| Input () | |
| Default constructor. | |
| bool | IsKeyDown (Key::Code KeyCode) const |
| Get the state of a key. | |
| bool | IsMouseButtonDown (Mouse::Button Button) const |
| Get the state of a mouse button. | |
| bool | IsJoystickButtonDown (unsigned int JoyId, unsigned int Button) const |
| Get the state of a joystick button. | |
| int | GetMouseX () const |
| Get the mouse X position. | |
| int | GetMouseY () const |
| Get the mouse Y position. | |
| float | GetJoystickAxis (unsigned int JoyId, Joy::Axis Axis) const |
| Get a joystick axis position. | |
Input handles real-time input from keyboard and mouse.
Use it instead of events to handle continuous moves and more game-friendly inputs
| sf::Input::Input | ( | ) |
Default constructor.
| float sf::Input::GetJoystickAxis | ( | unsigned int | JoyId, |
| Joy::Axis | Axis ) const |
Get a joystick axis position.
| JoyId | : Identifier of the joystick to check (0 or 1) |
| Axis | : Axis to get |
| int sf::Input::GetMouseX | ( | ) | const |
Get the mouse X position.
| int sf::Input::GetMouseY | ( | ) | const |
Get the mouse Y position.
| bool sf::Input::IsJoystickButtonDown | ( | unsigned int | JoyId, |
| unsigned int | Button ) const |
Get the state of a joystick button.
| JoyId | : Identifier of the joystick to check (0 or 1) |
| Button | : Button to check |
| bool sf::Input::IsKeyDown | ( | Key::Code | KeyCode | ) | const |
Get the state of a key.
| KeyCode | : Key to check |
| bool sf::Input::IsMouseButtonDown | ( | Mouse::Button | Button | ) | const |
Get the state of a mouse button.
| Button | : Button to check |