Handles keyboard and mouse input. Tracks key states, mouse buttons, and mouse movement.
More...
#include <InputManager.hpp>
Handles keyboard and mouse input. Tracks key states, mouse buttons, and mouse movement.
◆ InputManager()
| Engine::InputManager::InputManager |
( |
| ) |
|
◆ ~InputManager()
| Engine::InputManager::~InputManager |
( |
| ) |
|
◆ getMouseDelta()
Returns the delta movement of the mouse since last frame.
◆ getMousePosition()
| Maths::Vec2f Engine::InputManager::getMousePosition |
( |
| ) |
const |
Returns the current mouse position.
◆ getPreviousMousePosition()
| Maths::Vec2f Engine::InputManager::getPreviousMousePosition |
( |
| ) |
const |
Returns the previous mouse position.
◆ init()
| void Engine::InputManager::init |
( |
| ) |
|
Initializes the input system. Must be called before using input functions.
◆ isKeyHeld()
| bool Engine::InputManager::isKeyHeld |
( |
Scancode | scancode | ) |
const |
Checks if the key is being held down.
◆ isKeyPressed()
| bool Engine::InputManager::isKeyPressed |
( |
Scancode | scancode | ) |
const |
Checks if the key was pressed this frame.
◆ isKeyReleased()
| bool Engine::InputManager::isKeyReleased |
( |
Scancode | scancode | ) |
const |
Checks if the key was released this frame.
◆ isMouseHeld()
| bool Engine::InputManager::isMouseHeld |
( |
MouseButton | button | ) |
const |
Checks if the mouse button is being held down.
◆ isMousePressed()
| bool Engine::InputManager::isMousePressed |
( |
MouseButton | button | ) |
const |
Checks if the mouse button was pressed this frame.
◆ isMouseReleased()
| bool Engine::InputManager::isMouseReleased |
( |
MouseButton | button | ) |
const |
Checks if the mouse button was released this frame.
◆ setMousePosition()
| void Engine::InputManager::setMousePosition |
( |
Maths::Vec2f | pos | ) |
|
Sets the current mouse position.
◆ update()
| void Engine::InputManager::update |
( |
| ) |
|
Updates the internal input state. Should be called once per frame.
◆ updateKey()
| void Engine::InputManager::updateKey |
( |
Scancode | scancode, |
|
|
bool | isDown ) |
Updates the state of a keyboard key.
- Parameters
-
| scancode | Key scancode |
| isDown | Whether the key is pressed |
◆ updateMouseButton()
| void Engine::InputManager::updateMouseButton |
( |
MouseButton | button, |
|
|
bool | isDown ) |
Updates the state of a mouse button.
- Parameters
-
| button | Mouse button |
| isDown | Whether the button is pressed |
The documentation for this class was generated from the following file: