ASAPCabinetFE
 
Loading...
Searching...
No Matches
InputManager Class Reference

Processes SDL input events and triggers application actions. More...

#include <input_manager.h>

+ Inheritance diagram for InputManager:
+ Collaboration diagram for InputManager:

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 &currentIndex, 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.
 
- Public Member Functions inherited from IInputManager
virtual ~IInputManager ()=default
 Virtual destructor for proper cleanup of derived classes.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ InputManager()

InputManager::InputManager ( IKeybindProvider keybindProvider)

Constructs an InputManager instance.

Initializes the input manager with a keybind provider for mapping inputs to actions.

Parameters
keybindProviderThe keybind provider for input mappings.
+ Here is the call graph for this function:

Member Function Documentation

◆ handleEvent()

void InputManager::handleEvent ( const SDL_Event &  event)
overridevirtual

Handles an SDL input event.

Processes the provided SDL event (keyboard, joystick, mouse) and triggers the corresponding action based on the keybind configuration.

Parameters
eventThe SDL event to process.

Implements IInputManager.

+ Here is the call graph for this function:

◆ isCatalogActive()

bool InputManager::isCatalogActive ( ) const
inlineoverridevirtual

Checks if the metadata catalog UI is active.

Returns
True if the catalog UI is visible, false otherwise.

Implements IInputManager.

◆ isConfigActive()

bool InputManager::isConfigActive ( ) const
inlineoverridevirtual

Checks if the configuration UI is active.

Returns
True if the configuration UI is visible, false otherwise.

Implements IInputManager.

◆ isEditorActive()

bool InputManager::isEditorActive ( ) const
inlineoverridevirtual

Checks if the metadata editor UI is active.

Returns
True if the editor UI is visible, false otherwise.

Implements IInputManager.

◆ registerActions()

void InputManager::registerActions ( )
overridevirtual

Registers action handlers for input events.

Sets up the mapping of action identifiers to their corresponding handler functions.

Implements IInputManager.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDependencies()

void InputManager::setDependencies ( IAssetManager assets,
ISoundManager sound,
IConfigService settings,
size_t &  currentIndex,
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 
)
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.

Parameters
assetsThe asset manager for accessing textures and video players.
soundThe sound manager for playing UI sounds.
settingsThe configuration service for accessing settings.
currentIndexReference to the current table index.
tablesThe list of table data.
showConfigReference to the configuration UI visibility flag.
exeDirThe executable directory for resolving paths.
screenshotManagerThe screenshot manager for screenshot mode.
windowManagerThe window manager for renderer access.

Implements IInputManager.

◆ setRuntimeEditor()

void InputManager::setRuntimeEditor ( ConfigUI editor)
inlineoverridevirtual

Sets the runtime configuration editor.

Assigns the configuration UI editor for runtime settings adjustments.

Parameters
editorThe configuration UI editor to set.

Implements IInputManager.

◆ shouldQuit()

bool InputManager::shouldQuit ( ) const
inlineoverridevirtual

Checks if the application should quit.

Returns
True if a quit action has been triggered, false otherwise.

Implements IInputManager.


The documentation for this class was generated from the following files: