Skip to main content

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

FieldValue
Kindaction
EnvironmentB1 - Presentation
Categoryactions
ExtendsUB1UserWidgetBase

Properties (18)

NameTypeDescription
BW_KeyContaineranyKey container - lays out the key combination horizontally (BindWidget).
ContentHorizontalAlignmentanyHorizontal alignment of inner child widgets (key images, separators, etc.).
ContentVerticalAlignmentanyVertical alignment of inner child widgets (key images, separators, etc.).
DefaultIconWidgetanyDynamically created default icon widget (for internal management).
DefaultKeyIconTextureanyDefault icon texture shown in BW_KeyContainer when there is no valid key (auto-sized by IconSize).
DirectKeyFKeyFKey to display directly (used when bUseMappingName=false).
EditorPreviewWidgetsany[]Dummy widgets for editor preview.
IconSizeFVector2DIcon size.
KeyImagesany[]Dynamically created key images.
KeyRowsany[]Dynamically created key rows.
MappingNamestringMappingName 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.
PlusFontSizeintegerThe "+" separator font size.
PlusSeparatorTextstringThe "+" separator text.
PlusSeparatorTextsany[]Dynamically created "+" separator texts.
RecycledKeyImagesany[]
RecycledRowsany[]Reuse pool to prevent UObject accumulation.
RecycledTextBlocksany[]
bUseMappingNamebooleantrue: look up the action by MappingName (key-customization linked); false: display DirectKey directly.

Functions (5)

FunctionParametersReturnsDescription
HasValidKey-booleanChecks whether the currently displayed key is valid.
RefreshKeyDisplay--Manual refresh.
SetActionByMappingNameInMappingName: string-Sets the action by MappingName. Auto-looks up that MappingName's key and Chord Action (modifier) from the IMC.
SetDirectKeyInKey: 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]).
SetInputActionInAction: UInputAction-Sets directly by InputAction (single key only). Auto-extracts the MappingName. Use SetActionByMappingName to show combo keys.