You are viewing documentation for v1.1. Switch to current version →

⌨️ Input Bridging

Short Description

Input Bridging maps hardware input actions to conceptual gameplay tags, allowing the UI to remain agnostic of the specific input device.

Long Description

The Input Bridging system acts as a translator between Unreal's Enhanced Input and the Signal Bridge. Instead of widgets listening for specific keys or input actions, they listen for Conceptual Tags (e.g., UI.Action.Confirm, UI.Action.Back). The UGorgeousInputBinding_DA data asset maps these tags to UInputAction assets. This decoupling enables easy remapping, cross-platform icon swapping, and allows UI logic to be triggered by either hardware input or programmatic signals.

🚀 Features

  • Conceptual Mapping: Decouple UI logic from specific keys using FGameplayTag.
  • Enhanced Input Integration: Leverage the full power of Enhanced Input (triggers, modifiers) through tag-based dispatch.
  • Signal Forwarding: Automatically forward input events to the Signal Bridge for reactive UI updates.
  • Platform-Aware: Integrated with the theme system to show the correct hardware icon for the active action.
  • Dynamic Remapping: Swap input bindings at runtime by changing the active UGorgeousInputBinding_DA.

📚 Usage Examples

Create a Gorgeous Input Binding Data Asset. Add an entry for the tag UI.Action.Confirm and link it to your IA_UI_Confirm Enhanced Input Action asset.

In your widget, listen for the UI.Action.Confirm signal on the Signal Bridge. The subsystem will automatically dispatch this signal when the user presses the bound key.

🔄 Input Flow

graph LR
    Key[Key Press] --> IA[Enhanced Input Action]
    IA --> Sub[UI Foundation Subsystem]
    Sub -->|Look up Tag| Bindings[Input Binding Data Asset]
    Bindings --> Tag[Conceptual Tag: UI.Action.Confirm]
    Tag --> Bridge[Signal Bridge]
    Bridge --> Widget[Registered Widgets]

Best Practices

  • Action-Based Tags: Use descriptive tags for what the action does (e.g., UI.Action.Inventory.Sort) rather than the key it's bound to.
  • Contextual Bindings: Use different Input Binding assets for different UI modes (e.g., one for the Main Menu, another for in-game Inventory).
  • Consistency: Use the same Action Tags across your project to ensure that the "Back" action always behaves consistently regardless of the screen.

Troubleshooting

  • Input Not Registering: Ensure your UInputMappingContext is pushed to the player and that the UGorgeousInputBinding_DA contains an entry for the input action you are using.
  • Signal Loop: Avoid dispatching the same action tag manually from within a listener for that tag, as it can cause an infinite signal loop.
  • Wrong Icon Shown: If the wrong hardware icon is shown, verify that the active theme has an entry for the ActionTag and the current PlatformName.