The InputManager class is responsible for handling user input events, including keyboard and mouse input. It allows subscribers to register for specific input events (key presses and mouse button events) and notifies them when the events occur.
More...
#include <InputManager.h>
The InputManager class is responsible for handling user input events, including keyboard and mouse input. It allows subscribers to register for specific input events (key presses and mouse button events) and notifies them when the events occur.
◆ InputManager() [1/2]
InputManager::InputManager |
( |
| ) |
|
|
default |
◆ ~InputManager()
InputManager::~InputManager |
( |
| ) |
|
◆ InputManager() [2/2]
◆ HandleInputs()
void InputManager::HandleInputs |
( |
SDL_Event & | pEvent | ) |
|
Handles input events (key and mouse events) and notifies the corresponding listeners.
- Parameters
-
pEvent | The SDL event to be processed. |
◆ Instance()
◆ operator=()
◆ SubscribeToKey()
void InputManager::SubscribeToKey |
( |
SDL_Keycode | pKeyCode, |
|
|
IInputListener * | pListener ) |
Subscribes a listener to a specific keyboard key event.
- Parameters
-
pKeyCode | The SDL keycode for the key to subscribe to. |
pListener | The listener that will be notified when the key event occurs. |
◆ SubscribeToMouse()
void InputManager::SubscribeToMouse |
( |
Uint8 | pButton, |
|
|
IInputListener * | pListener ) |
Subscribes a listener to a specific mouse button event.
- Parameters
-
pButton | The SDL mouse button to subscribe to (e.g., SDL_BUTTON_LEFT). |
pListener | The listener that will be notified when the mouse button event occurs. |
◆ UnSubscribeToAllEvents()
void InputManager::UnSubscribeToAllEvents |
( |
IInputListener * | pListener | ) |
|
Unsubscribes from a listener.
- Parameters
-
pListener | The listener that we want to unsubscribe of. |
The documentation for this class was generated from the following files: