StevEngine
StevEngine is a customizable C++ game engine.
|
Handles input processing and management. More...
#include <inputs/InputSystem.hpp>
Public Member Functions | |
void | Init () |
Initialize input system. | |
EventManager * | GetEvents () |
Get input events manager. | |
bool | IsKeyPressed (SDL_Keycode key) const |
Check if key is currently pressed. | |
void | ForcePressKey (SDL_Keycode key, bool value) |
Force key press state. | |
bool | IsMouseButtonPressed (Uint8 button) const |
Check if mouse button is currently pressed. | |
Utilities::Vector2 | GetMousePosition () const |
Get current mouse position. | |
Utilities::Vector2 | GetMouseDelta () const |
Get mouse movement since last frame. | |
Public Attributes | |
CursorMode | cursorMode = Free |
Current cursor behavior mode. | |
bool | cursorVisible = true |
Whether cursor is visible. | |
Handles input processing and management.
Processes keyboard, mouse and cursor input events. Maintains input state and provides methods to query input status.
void StevEngine::InputManager::ForcePressKey | ( | SDL_Keycode | key, |
bool | value ) |
Force key press state.
key | SDL keycode to set |
value | Pressed state to set |
Log::Debug(std::format("Changed pressed status of key ({}) to {}", SDL_GetKeyName(key), value), true);
|
inline |
Get input events manager.
|
inline |
Get mouse movement since last frame.
|
inline |
Get current mouse position.
bool StevEngine::InputManager::IsKeyPressed | ( | SDL_Keycode | key | ) | const |
Check if key is currently pressed.
key | SDL keycode to check |
Log::Debug(std::format("Key ({}) has pressed value of {}", SDL_GetKeyName(key), pressed), true);
bool StevEngine::InputManager::IsMouseButtonPressed | ( | Uint8 | button | ) | const |
Check if mouse button is currently pressed.
button | Mouse button ID to check |
Log::Debug(std::format("Mouse button ({}) has pressed value of {}", button, pressed), true);