User input event dispatcher. More...
Inherits Polycode::EventDispatcher.
Public Member Functions | |
Vector2 | getMousePosition () |
Returns the current mouse position. | |
bool | getKeyState (PolyKEY keyCode) |
Returns the state of the specified key. | |
Vector2 | getMouseDelta () |
Returns the current mouse position as delta from last frame. | |
bool | getMouseButtonState (int mouseButton) |
Returns the state of the specified mouse button. | |
Static Public Attributes | |
static const int | MOUSE_BUTTON1 = 0 |
Left mouse button. | |
static const int | MOUSE_BUTTON2 = 1 |
Right mouse button. | |
static const int | MOUSE_BUTTON3 = 2 |
Middle mouse button. |
User input event dispatcher.
The Core input class is where all of the input events originate. You can add event listeners to this class to listen for user input events or poll it manually to check the state of user input.
bool Polycode::CoreInput::getKeyState | ( | PolyKEY | keyCode | ) |
Returns the state of the specified key.
keyCode | The key to check for |
bool Polycode::CoreInput::getMouseButtonState | ( | int | mouseButton | ) |
Returns the state of the specified mouse button.
mouseButton | Mouse button to check the state of. Possible values are CoreInput::MOUSE_BUTTON1, CoreInput::MOUSE_BUTTON2 and CoreInput::MOUSE_BUTTON3 |
Vector2 Polycode::CoreInput::getMouseDelta | ( | ) |
Returns the current mouse position as delta from last frame.
Vector2 Polycode::CoreInput::getMousePosition | ( | ) |
Returns the current mouse position.