UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
InputKeySelector.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
9#include "Layout/Margin.h"
10#include "Widgets/SWidget.h"
11#include "Components/Widget.h"
12#include "Styling/SlateTypes.h"
13#include "Layout/Visibility.h"
14#include "InputKeySelector.generated.h"
15
17struct FButtonStyle;
18
20UCLASS(MinimalAPI)
22{
24
25public:
28
29public:
30 UE_DEPRECATED(5.2, "Direct access to WidgetStyle is now deprecated. Use the setter or getter.")
32 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter = "GetButtonStyle", Setter = "SetButtonStyle", Category = Appearance, meta = (DisplayName = "Style"))
33 FButtonStyle WidgetStyle;
34
35 UE_DEPRECATED(5.2, "Direct access to TextStyle is now deprecated. Use the setter or getter.")
37 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = Appearance, meta = (DisplayName = "Text Style"))
38 FTextBlockStyle TextStyle;
39
40 UE_DEPRECATED(5.2, "Direct access to SelectedKey is now deprecated. Use the setter or getter.")
42 UPROPERTY( BlueprintReadWrite, Getter, Setter, BlueprintSetter = "SetSelectedKey", FieldNotify, Category = "Key Selection")
43 FInputChord SelectedKey;
44
45 UE_DEPRECATED(5.2, "Direct access to Margin is now deprecated. Use the setter or getter.")
47 UPROPERTY( EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = Appearance )
48 FMargin Margin;
49
50 UE_DEPRECATED(5.2, "Direct access to KeySelectionText is now deprecated. Use the setter or getter.")
52 UPROPERTY( EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = "SetKeySelectionText", Category = Appearance )
53 FText KeySelectionText;
54
55 UE_DEPRECATED(5.2, "Direct access to NoKeySpecifiedText is now deprecated. Use the setter or getter.")
57 UPROPERTY( EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = "SetNoKeySpecifiedText", Category = Appearance )
58 FText NoKeySpecifiedText;
59
60 UE_DEPRECATED(5.2, "Direct access to bAllowModifierKeys is now deprecated. Use the setter or getter.")
65 UPROPERTY( EditAnywhere, BlueprintReadWrite, Getter = "AllowModifierKeys", Setter = "SetAllowModifierKeys", BlueprintSetter = "SetAllowModifierKeys", Category = "Key Selection")
66 bool bAllowModifierKeys;
67
68 UE_DEPRECATED(5.2, "Direct access to bAllowGamepadKeys is now deprecated. Use the setter or getter.")
70 UPROPERTY( EditAnywhere, BlueprintReadWrite, Getter = "AllowGamepadKeys", Setter = "SetAllowGamepadKeys", BlueprintSetter = "SetAllowGamepadKeys", Category = "Key Selection")
71 bool bAllowGamepadKeys;
72
74 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Key Selection")
75 TArray<FKey> EscapeKeys;
76
77public:
79 UPROPERTY( BlueprintAssignable, Category = "Widget Event" )
80 FOnKeySelected OnKeySelected;
81
83 UPROPERTY( BlueprintAssignable, Category = "Widget Event" )
84 FOnIsSelectingKeyChanged OnIsSelectingKeyChanged;
85
87 UFUNCTION( BlueprintCallable, Category = "Widget" )
88 UMG_API void SetSelectedKey(const FInputChord& InSelectedKey);
89
91 UMG_API FInputChord GetSelectedKey() const;
92
94 UFUNCTION( BlueprintCallable, Category = "Widget" )
95 UMG_API void SetKeySelectionText( FText InKeySelectionText );
96
98 UMG_API const FText& GetKeySelectionText() const;
99
101 UFUNCTION(BlueprintCallable, Category = "Widget")
102 UMG_API void SetNoKeySpecifiedText(FText InNoKeySpecifiedText);
103
105 UMG_API const FText& GetNoKeySpecifiedText() const;
106
108 UFUNCTION(BlueprintCallable, Category = "Widget" )
109 UMG_API void SetAllowModifierKeys(bool bInAllowModifierKeys );
110
112 UMG_API bool AllowModifierKeys() const;
113
115 UFUNCTION(BlueprintCallable, Category = "Widget")
116 UMG_API void SetAllowGamepadKeys(bool bInAllowGamepadKeys);
117
119 UMG_API bool AllowGamepadKeys() const;
120
122 UFUNCTION( BlueprintCallable, Category = "Widget" )
123 UMG_API bool GetIsSelectingKey() const;
124
126 UFUNCTION(BlueprintCallable, Category = "Widget")
127 UMG_API void SetTextBlockVisibility(const ESlateVisibility InVisibility);
128
130 UMG_API void SetButtonStyle(const FButtonStyle& ButtonStyle);
131
133 UE_DEPRECATED(5.2, "SetButtonStyle with pointer type parameter is deprecated. Please pass a reference instead.")
134 UMG_API void SetButtonStyle(const FButtonStyle* ButtonStyle);
135
137 UMG_API const FButtonStyle& GetButtonStyle() const;
138
140 UMG_API void SetTextStyle(const FTextBlockStyle& InTextStyle);
141
143 UMG_API const FTextBlockStyle& GetTextStyle() const;
144
146 UMG_API void SetMargin(const FMargin& InMargin);
147
149 UMG_API const FMargin& GetMargin() const;
150
152 UFUNCTION(BlueprintCallable, Category = "Widget")
153 UMG_API void SetEscapeKeys(const TArray<FKey>& InKeys);
154
155 //~ Begin UWidget Interface
156#if WITH_EDITOR
157 UMG_API virtual const FText GetPaletteCategory() override;
158#endif
159 UMG_API virtual void SynchronizeProperties() override;
160 //~ End UWidget Interface
161
162protected:
163 //~ Begin UObject Interface
164 UMG_API virtual void Serialize(FArchive& Ar) override;
165 //~ End UObject Interface
166
167 //~ Begin UWidget Interface
168 UMG_API virtual TSharedRef<SWidget> RebuildWidget() override;
169 //~ End UWidget Interface
170
171 //~ Begin UVisual Interface
172 UMG_API virtual void ReleaseSlateResources(bool bReleaseChildren) override;
173 //~ End UVisual Interface
174
175private:
176 UMG_API virtual void HandleKeySelected(const FInputChord& InSelectedKey);
177 void HandleIsSelectingKeyChanged();
178
179private:
181 TSharedPtr<SInputKeySelector> MyInputKeySelector;
182};
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
ESlateVisibility
Definition SlateWrapperTypes.h:22
Definition Archive.h:1208
Definition UnrealType.h:3087
Definition Text.h:385
Definition SInputKeySelector.h:27
Definition Array.h:670
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition InputKeySelector.h:22
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnKeySelected, FInputChord, SelectedKey)
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnIsSelectingKeyChanged)
Definition Widget.h:217
Definition SlateTypes.h:509
Definition InputChord.h:24
Definition InputCoreTypes.h:50
Definition Margin.h:17
Definition SlateTypes.h:326