|
| | ControlDeck (std::vector< CONTROLLERBUTTONS_T > additionalBitmasks, std::shared_ptr< ControllerDefaultMappings > controllerDefaultMappings, std::unordered_map< CONTROLLERBUTTONS_T, std::string > buttonNames, std::shared_ptr< Window > window=nullptr, std::shared_ptr< ConsoleVariable > consoleVariable=nullptr) |
| | Constructs the ControlDeck and sets up the port list.
|
| |
| | ~ControlDeck () |
| |
| void | Init (uint8_t *controllerBits) |
| | Initialises the controller deck and loads saved mappings from Config.
|
| |
| virtual void | WriteToPad (void *pads)=0 |
| | Reads controller state and writes it to the game-specific pad structure(s).
|
| |
| uint8_t * | GetControllerBits () |
| | Returns the pointer passed to Init() that tracks which ports have controllers.
|
| |
| std::shared_ptr< Controller > | GetControllerByPort (uint8_t port) |
| | Returns the Controller connected to the given port, or nullptr.
|
| |
| void | BlockGameInput (int32_t blockId) |
| | Blocks all game input for the caller identified by blockId.
|
| |
| void | UnblockGameInput (int32_t blockId) |
| | Removes the block associated with blockId.
|
| |
| bool | GamepadGameInputBlocked () |
| | Returns true if any blocker has blocked gamepad game input.
|
| |
| bool | KeyboardGameInputBlocked () |
| | Returns true if any blocker has blocked keyboard game input.
|
| |
| bool | MouseGameInputBlocked () |
| | Returns true if any blocker has blocked mouse game input.
|
| |
| bool | ProcessKeyboardEvent (KbEventType eventType, KbScancode scancode) |
| | Forwards a keyboard event to all controllers that have keyboard bindings.
|
| |
| bool | ProcessMouseButtonEvent (bool isPressed, MouseBtn button) |
| | Forwards a mouse-button event to all controllers that have mouse bindings.
|
| |
| std::shared_ptr< ConnectedPhysicalDeviceManager > | GetConnectedPhysicalDeviceManager () |
| | Returns the manager that tracks currently connected SDL/HID devices.
|
| |
| std::shared_ptr< GlobalSDLDeviceSettings > | GetGlobalSDLDeviceSettings () |
| | Returns the global SDL device settings (dead-zone, axis scale, etc.).
|
| |
| std::shared_ptr< ControllerDefaultMappings > | GetControllerDefaultMappings () |
| | Returns the default mapping configuration applied to new controllers.
|
| |
| std::shared_ptr< WheelHandler > | GetWheelHandler () const |
| | Returns the cached wheel handler.
|
| |
| const std::unordered_map< CONTROLLERBUTTONS_T, std::string > & | GetAllButtonNames () const |
| | Returns the full bitmask→name map for all registered buttons.
|
| |
| std::string | GetButtonNameForBitmask (CONTROLLERBUTTONS_T bitmask) |
| | Returns the human-readable name for the given button bitmask.
|
| |
| | Component (const std::string &name, std::shared_ptr< Context > context=nullptr) |
| | Constructs a Component with the given name.
|
| |
| virtual | ~Component () |
| |
| void | Init (const nlohmann::json &initArgs=nlohmann::json::object()) |
| | Performs one-time initialization of this component.
|
| |
| bool | IsInitialized () const |
| | Returns true once Init() (or MarkInitialized()) has completed successfully.
|
| |
| const std::string & | GetName () const |
| | Returns the name of this Component.
|
| |
| std::string | ToString () const |
| | Returns a human-readable string representation (e.g. "Name (id)").
|
| |
| std::string | ToTreeString (int depth=0) const |
| | Returns a human-readable tree representation of this component and its children.
|
| |
| | operator std::string () const |
| | Conversion operator to std::string; equivalent to ToString().
|
| |
| ParentComponentList & | GetParents () |
| | Returns a mutable reference to the parent list.
|
| |
| const ParentComponentList & | GetParents () const |
| | Returns a const reference to the parent list.
|
| |
| ComponentList & | GetChildren () |
| | Returns a mutable reference to the child list.
|
| |
| const ComponentList & | GetChildren () const |
| | Returns a const reference to the child list.
|
| |
| virtual std::shared_ptr< Component > | TryGetSharedComponent () noexcept |
| | Returns a shared_ptr to this Component when available, otherwise nullptr.
|
| |
| virtual std::shared_ptr< Component > | GetSharedComponent () |
| | Returns a shared_ptr to this Component via the correct enable_shared_from_this base.
|
| |
| template<typename T > |
| bool | HasInChildren () const |
| | Checks whether any descendant Component matches type T via BFS.
|
| |
| template<typename T > |
| std::shared_ptr< T > | GetFirstInChildren () const |
| | Returns the first descendant that matches type T via BFS.
|
| |
| template<typename T > |
| std::shared_ptr< std::vector< std::shared_ptr< T > > > | GetInChildren () const |
| | Returns all descendants that match type T via BFS.
|
| |
| template<typename T > |
| bool | HasInParents () const |
| | Checks whether any ancestor Component matches type T via BFS.
|
| |
| template<typename T > |
| std::shared_ptr< T > | GetFirstInParents () const |
| | Returns the first ancestor that matches type T via BFS.
|
| |
| template<typename T > |
| std::shared_ptr< std::vector< std::shared_ptr< T > > > | GetInParents () const |
| | Returns all ancestors that match type T via BFS.
|
| |
| | Part () |
| | Constructs a Part and assigns it a unique ID.
|
| |
| | Part (std::shared_ptr< Context > context) |
| | Constructs a Part with an explicit Context reference and unique ID.
|
| |
| virtual | ~Part ()=default |
| |
| uint64_t | GetId () const |
| | Returns the unique identifier for this Part.
|
| |
| bool | operator== (const Part &other) const |
| | Compares two Parts for equality by their unique IDs.
|
| |
| std::shared_ptr< Context > | GetContext () const |
| | Returns the Context this Part belongs to, or nullptr if unset.
|
| |
| void | SetContext (std::shared_ptr< Context > ctx) |
| | Sets the Context this Part belongs to.
|
| |
Manages all controller ports and routes input/blocking requests.
ControlDeck is the top-level controller subsystem. It owns a fixed set of ControlPort instances, one per supported controller port, and exposes the game-facing API for:
- Writing pad state from connected controllers (via the pure-virtual WriteToPad()).
- Blocking / unblocking game input globally (e.g. while the ImGui overlay is focused).
- Forwarding keyboard and mouse events to the mapping layer.
- Providing access to physical device management and default-mapping configuration.
Subclass ControlDeck to implement WriteToPad() for a specific game's pad layout.
Required dependencies (constructor-injected): Window, ConsoleVariable
- ConsoleVariable — injected at construction and used by controller mapping layers to load/save per-mapping settings (e.g. button assignments, rumble toggle).
- Window — injected at construction and consulted by controller mappings for keyboard/mouse capture state.
Obtain the instance from Context::GetChildren().GetFirst<ControlDeck>().