Processes SDL input events and triggers application actions. More...
#include <input_manager.h>
Public Member Functions | |
InputManager (IKeybindProvider *keybindProvider) | |
Constructs an InputManager instance. | |
void | handleEvent (const SDL_Event &event) override |
Handles an SDL input event. | |
void | registerActions () override |
Registers action handlers for input events. | |
void | setDependencies (IAssetManager *assets, ISoundManager *sound, IConfigService *settings, size_t ¤tIndex, std::vector< TableData > &tables, bool &showConfig, bool &showEditor, bool &showVpsdb, const std::string &exeDir, IScreenshotManager *screenshotManager, IWindowManager *windowManager, std::atomic< bool > &isLoadingTables, ITableLauncher *tableLauncher, ITableCallbacks *tableCallbacks) override |
Sets dependencies for input handling. | |
bool | isConfigActive () const override |
Checks if the configuration UI is active. | |
bool | isEditorActive () const override |
Checks if the metadata editor UI is active. | |
bool | isCatalogActive () const override |
Checks if the metadata catalog UI is active. | |
bool | shouldQuit () const override |
Checks if the application should quit. | |
void | setRuntimeEditor (ConfigUI *editor) override |
Sets the runtime configuration editor. | |
![]() | |
virtual | ~IInputManager ()=default |
Virtual destructor for proper cleanup of derived classes. | |
Processes SDL input events and triggers application actions.
This class implements the IInputManager interface to handle keyboard, joystick, and mouse events, mapping them to actions via IKeybindProvider. It coordinates with other components (IAssetManager, ISoundManager, IConfigService, IScreenshotManager) to update the application state, such as navigating tables, launching screenshots, or showing the configuration UI.
InputManager::InputManager | ( | IKeybindProvider * | keybindProvider | ) |
Constructs an InputManager instance.
Initializes the input manager with a keybind provider for mapping inputs to actions.
keybindProvider | The keybind provider for input mappings. |
|
overridevirtual |
Handles an SDL input event.
Processes the provided SDL event (keyboard, joystick, mouse) and triggers the corresponding action based on the keybind configuration.
event | The SDL event to process. |
Implements IInputManager.
|
inlineoverridevirtual |
Checks if the metadata catalog UI is active.
Implements IInputManager.
|
inlineoverridevirtual |
Checks if the configuration UI is active.
Implements IInputManager.
|
inlineoverridevirtual |
Checks if the metadata editor UI is active.
Implements IInputManager.
|
overridevirtual |
Registers action handlers for input events.
Sets up the mapping of action identifiers to their corresponding handler functions.
Implements IInputManager.
|
overridevirtual |
Sets dependencies for input handling.
Configures the input manager with references to other components and data needed for action handling, such as assets, sound, settings, and table data.
assets | The asset manager for accessing textures and video players. |
sound | The sound manager for playing UI sounds. |
settings | The configuration service for accessing settings. |
currentIndex | Reference to the current table index. |
tables | The list of table data. |
showConfig | Reference to the configuration UI visibility flag. |
exeDir | The executable directory for resolving paths. |
screenshotManager | The screenshot manager for screenshot mode. |
windowManager | The window manager for renderer access. |
Implements IInputManager.
|
inlineoverridevirtual |
Sets the runtime configuration editor.
Assigns the configuration UI editor for runtime settings adjustments.
editor | The configuration UI editor to set. |
Implements IInputManager.
|
inlineoverridevirtual |
Checks if the application should quit.
Implements IInputManager.