UB1ActionKeyWidget
Overview
- Widget that automatically displays the key icon bound by an InputAction's MappingName. Auto-switches by keyboard/gamepad input type, auto-detects Chord Actions (combo keys) and shows modifiers, and auto-refreshes when key customization changes. Example: SetActionByMappingName("ToggleMapAction") -> keyboard mode: [M] -> gamepad mode: [Y] + [X] (Chord Action auto-detected).
Metadata
| Field | Value |
|---|---|
| Kind | action |
| Environment | B1 - Presentation |
| Category | actions |
| Extends | UB1UserWidgetBase |
Properties (18)
| Name | Type | Description |
|---|---|---|
BW_KeyContainer | any | Key container - lays out the key combination horizontally (BindWidget). |
ContentHorizontalAlignment | any | Horizontal alignment of inner child widgets (key images, separators, etc.). |
ContentVerticalAlignment | any | Vertical alignment of inner child widgets (key images, separators, etc.). |
DefaultIconWidget | any | Dynamically created default icon widget (for internal management). |
DefaultKeyIconTexture | any | Default icon texture shown in BW_KeyContainer when there is no valid key (auto-sized by IconSize). |
DirectKey | FKey | FKey to display directly (used when bUseMappingName=false). |
EditorPreviewWidgets | any[] | Dummy widgets for editor preview. |
IconSize | FVector2D | Icon size. |
KeyImages | any[] | Dynamically created key images. |
KeyRows | any[] | Dynamically created key rows. |
MappingName | string | MappingName of the action to display (used when bUseMappingName=true). Set directly in the editor or at runtime via SetActionByMappingName(). Auto-detects the Chord Action (modifier) from the IMC. |
PlusFontSize | integer | The "+" separator font size. |
PlusSeparatorText | string | The "+" separator text. |
PlusSeparatorTexts | any[] | Dynamically created "+" separator texts. |
RecycledKeyImages | any[] | |
RecycledRows | any[] | Reuse pool to prevent UObject accumulation. |
RecycledTextBlocks | any[] | |
bUseMappingName | boolean | true: look up the action by MappingName (key-customization linked); false: display DirectKey directly. |
Functions (5)
| Function | Parameters | Returns | Description |
|---|---|---|---|
HasValidKey | - | boolean | Checks whether the currently displayed key is valid. |
RefreshKeyDisplay | - | - | Manual refresh. |
SetActionByMappingName | InMappingName: string | - | Sets the action by MappingName. Auto-looks up that MappingName's key and Chord Action (modifier) from the IMC. |
SetDirectKey | InKey: FKey, InModifier: EB1KeyboardModifierType | - | Displays the icon by specifying an FKey directly (shown directly without an Action lookup). Switches bUseMappingName to false and shows that key's icon. Specifying a modifier shows a combo key (e.g. [Ctrl] + [R]). |
SetInputAction | InAction: UInputAction | - | Sets directly by InputAction (single key only). Auto-extracts the MappingName. Use SetActionByMappingName to show combo keys. |