|
VR-Engage
2.2
|
DtInputLogic provides a centralized mechanism for managing input configurations and handling input events in VR-Engage. It allows loading input mapping configurations, registering callback functions for specific actions, and managing raw input handlers.
Input is organized into groups, which can be loaded, enabled, and disabled as units. This allows different parts of the application to manage their own input requirements without interfering with each other.
#include <inputLogic.h>
Public Member Functions | |
| DtInputLogic () | |
| virtual | ~DtInputLogic () |
| virtual void | initialize () |
| virtual void | shutdown () |
| virtual bool | loadInputConfig (const std::string &config, const std::string &group, bool alwaysOnTop=false, bool alwaysEnabled=false) |
| virtual void | unloadInputConfig (const std::string &category, const std::string &group) |
| virtual void | addActionHandler (const std::string &group, const std::string &action, const DtActionDelegate &handler) |
| virtual void | removeActionGroup (const std::string &group) |
| virtual void | setRawInputHandler (const DtInputDelegate &inputDelegate) |
| virtual void | removeRawInputHandler () |
| virtual void | removeActionHandler (const std::string &group, const std::string &action) |
Protected Attributes | |
| DtVreInputManager * | myInputManager |
| std::vector< std::pair< std::string, std::string > > | myInputConfigurations |
| std::unordered_map< std::string, std::vector< std::string > > | myActionGroups |
| bool | myHandlingRawInput |
| makVre::DtInputLogic::DtInputLogic | ( | ) |
Constructor.
Creates a new input logic handler with no configurations loaded.
|
virtual |
Virtual destructor.
Ensures proper cleanup of derived input logic handlers.
|
virtual |
Initializes the input logic system.
Sets up the input manager and prepares the system for input handling. This should be called before any other input logic methods.
Reimplemented in makVre::DtHumanInputLogic, makVre::DtLookAroundInputLogic, makVre::DtPilotInstrumentsInputLogic, makVre::DtPlayerStationAppInputLogic, makVre::DtSavedViewInputLogic, and makVre::DtSensorOperatorInputLogic.
|
virtual |
Shuts down the input logic system.
Removes all loaded input mappings and action callbacks from the input manager. This should be called when the system is no longer needed to properly clean up resources and prevent callback execution after destruction.
Reimplemented in makVre::DtLookAroundInputLogic, and makVre::DtSavedViewInputLogic.
|
virtual |
Loads input mappings from a configuration file.
| config | Name of the configuration file to load |
| group | Name of the group to associate with these mappings |
| alwaysOnTop | Whether these mappings should always be at the top of the priority stack |
| alwaysEnabled | Whether these mappings should always be enabled |
Loads mappings from the specified configuration file into the input manager, associating them with the given group name. The alwaysOnTop and alwaysEnabled parameters control the priority and activation state of the mappings.
|
virtual |
Removes previously loaded input mappings.
| category | Name of the mapping category to unload |
| group | Name of the group to unload |
Removes input mappings previously loaded from the specified category and group. This will prevent the mappings from triggering actions but does not remove the action handlers themselves.
|
virtual |
Registers a callback function to handle an input-triggered action.
| group | Name of the group to associate this handler with |
| action | Name of the action to handle |
| handler | Delegate function to call when the action is triggered |
Registers a callback function that will be called when the specified action is triggered by user input. The handler is associated with the given group, allowing for management of related action handlers as a unit.
|
virtual |
Removes all action handlers in a group.
| group | Name of the group to remove |
Removes all action handlers associated with the specified group. This is useful for cleaning up handlers when a component is being disabled or destroyed.
|
virtual |
Sets a handler for raw input events.
| inputDelegate | Delegate function to call for raw input events |
Sets a function to receive all raw input events before they are processed by the normal action system. This allows for custom input handling beyond the configured actions.
|
virtual |
Removes the current raw input handler.
Removes any previously set raw input handler, stopping the delivery of raw input events to the handler function.
|
virtual |
Unregisters a specific action callback.
| group | Name of the group containing the action |
| action | Name of the action to remove the handler for |
Removes the callback function for the specified action within the given group. After removal, the action will no longer trigger the callback.
|
protected |
Pointer to the VR-Engage input manager.
|
protected |
List of loaded input configurations (category, group pairs)
|
protected |
Map of action groups to lists of action names.
|
protected |
Flag indicating whether raw input handling is active.