Skip to content

Class USFSettingEntryWidget_Keybind

ClassList > USFSettingEntryWidget_Keybind

The native base class for a setting entry widget for a key bind setting, represented as buttons that listen for the next key press in the UI. More...

  • #include "UI/SettingEntries/SFSettingEntryWidget_Keybind.h"

Inherits the following classes: USFSettingEntryWidget

Public Attributes inherited from USFSettingEntryWidget

See USFSettingEntryWidget

Type Name
FOnSettingEntryFocused OnSettingFocused

Public Functions inherited from USFSettingEntryWidget

See USFSettingEntryWidget

Type Name
class USFSettingDefinition * GetSettingDefinition () const
FGameplayTag GetSettingTag () const
virtual void InitializeSettingEntry (const class USFSettingDefinition * InSettingDefinition)

Protected Attributes

Type Name
FSFKeybindValueData CurrentKeybindData
ESFKeybindSlot CurrentListeningSlot = ESFKeybindSlot::None
TObjectPtr< class UCommonButtonBase > GamepadButton
TObjectPtr< class UCommonButtonBase > KBMPrimaryButton
TObjectPtr< class UCommonButtonBase > KBMSecondaryButton

Protected Attributes inherited from USFSettingEntryWidget

See USFSettingEntryWidget

Type Name
TObjectPtr< class UCommonTextBlock > SettingLabel
FGameplayTag SettingTag

Protected Functions

Type Name
void ApplyNewKeybind (FKey NewKey)
void CancelListening ()
void ClearSlot (ESFKeybindSlot SlotToClear)
virtual void InitializeSettingEntry (const class USFSettingDefinition * InSettingDefinition) override
void SetSlotText (ESFKeybindSlot SlotToSet, FKey Key, bool bIsListening)
virtual void SetSlotText_Implementation (ESFKeybindSlot SlotToSet, FKey Key, bool bIsListening)
virtual void UpdateVisualValue_Implementation (const class USFSettingValue * NewValue) override

Protected Functions inherited from USFSettingEntryWidget

See USFSettingEntryWidget

Type Name
void BP_InitializeSettingEntry (const class USFSettingDefinition * InSettingDefinition)
void OnUserChangedValue (class USFSettingValue * NewValue)
void UpdateVisualValue (const class USFSettingValue * NewValue)
virtual void UpdateVisualValue_Implementation (const class USFSettingValue * NewValue)
void UpdateWidgetState ()

Detailed Description

Setting entry widget for keybind settings, represented as buttons that listens for the next key press in the UI.

The native base class for a setting entry widget for a key bind setting, represented as buttons that listen for the next key press in the UI.

The widget blueprint implementing this class should be assigned as a value to the SettingEntryWidgetClasses map with the key bind setting definition class (USFSettingDefinition_Key) as the key in the Developer Settings at Project Settings > Plugins > SettingsFramework.

Protected Attributes Documentation

variable CurrentKeybindData

FSFKeybindValueData USFSettingEntryWidget_Keybind::CurrentKeybindData;

The cached current keybind data for this setting entry, used to compare against new input and determine whether the value has actually changed and whether to apply the change to the subsystem.


variable CurrentListeningSlot

ESFKeybindSlot USFSettingEntryWidget_Keybind::CurrentListeningSlot;

Transient variable to track which keybind slot is currently listening for input for rebinding.


variable GamepadButton

TObjectPtr<class UCommonButtonBase> USFSettingEntryWidget_Keybind::GamepadButton;

Button widget for displaying and changing the gamepad keybind.

Note:

BlueprintReadOnly BindWidget


variable KBMPrimaryButton

TObjectPtr<class UCommonButtonBase> USFSettingEntryWidget_Keybind::KBMPrimaryButton;

Button widget for displaying and changing the primary KBM keybind.

Note:

BlueprintReadOnly BindWidget


variable KBMSecondaryButton

TObjectPtr<class UCommonButtonBase> USFSettingEntryWidget_Keybind::KBMSecondaryButton;

Button widget for displaying and changing the secondary KBM keybind.

Note:

BlueprintReadOnly BindWidget


Protected Functions Documentation

function ApplyNewKeybind

void USFSettingEntryWidget_Keybind::ApplyNewKeybind (
    FKey NewKey
) 

Apply the given key as the new keybind for the currently listening slot (specified by CurrentListeningSlot) and update it in the USFSettingsSubsystem instance.

Parameters:

  • NewKey The new keybind to apply for the currently listening slot.

function CancelListening

void USFSettingEntryWidget_Keybind::CancelListening () 

If the widget is in listening state, cancel it and update the button display to show the current keybind.


function ClearSlot

void USFSettingEntryWidget_Keybind::ClearSlot (
    ESFKeybindSlot SlotToClear
) 

Set the specified slot to have no keybind, update it in the USFSettingsSubsystem instance, and update the button display accordingly.

Parameters:

  • SlotToClear The keybind slot to clear the keybind for.

function InitializeSettingEntry

virtual void USFSettingEntryWidget_Keybind::InitializeSettingEntry (
    const class USFSettingDefinition * InSettingDefinition
) override

Initializes the data and display of this setting entry widget based on the assigned setting definition asset. Subclasses can override this function to hook up any setting type-specific logic or display elements, but should call the parent implementation to ensure the base functionality is executed (e.g., binding to setting value change events from the subsystem).

Parameters:

  • InSettingDefinition The setting definition asset represented by this widget.

Implements USFSettingEntryWidget::InitializeSettingEntry


function SetSlotText

void USFSettingEntryWidget_Keybind::SetSlotText (
    ESFKeybindSlot SlotToSet,
    FKey Key,
    bool bIsListening
) 

Cosmetically display the given key in the button widget for the specified slot, and update the display to indicate that the widget is currently listening for input if bIsListening is true.

Parameters:

  • SlotToSet The keybind slot for which to set the button text.
  • Key The key to display in the button widget for the specified slot.
  • bIsListening Whether the button widget for the specified slot should display as currently listening for input.

function SetSlotText_Implementation

inline virtual void USFSettingEntryWidget_Keybind::SetSlotText_Implementation (
    ESFKeybindSlot SlotToSet,
    FKey Key,
    bool bIsListening
) 

Native implementation of SetSlotText, can be optionally overridden by C++ subclasses.


function UpdateVisualValue_Implementation

virtual void USFSettingEntryWidget_Keybind::UpdateVisualValue_Implementation (
    const class USFSettingValue * NewValue
) override

Native implementation of UpdateVisualValue, can be optionally overridden by C++ subclasses to handle setting value change events from the subsystem.

Implements USFSettingEntryWidget::UpdateVisualValue_Implementation



The documentation for this class was generated from the following file Source/SettingsFramework/Public/UI/SettingEntries/SFSettingEntryWidget_Keybind.h