UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
KeyInputBehavior.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
7#include "CoreMinimal.h"
8#include "InputBehavior.h"
9#include "InputCoreTypes.h"
10#include "InputState.h"
11#include "InteractiveTool.h"
12#include "Templates/Function.h"
15
16#include "KeyInputBehavior.generated.h"
17
19class UObject;
20
21
44UCLASS(MinimalAPI)
46{
48
49public:
51
53 {
55 }
56
63
70
74 TFunction<bool(const FInputDeviceState&)> ModifierCheckFunc = nullptr;
75
76 // UInputBehavior implementation
79 INTERACTIVETOOLSFRAMEWORK_API virtual FInputCaptureUpdate UpdateCapture(const FInputDeviceState& Input, const FInputCaptureData& Data) override;
80 INTERACTIVETOOLSFRAMEWORK_API virtual void ForceEndCapture(const FInputCaptureData& Data) override;
81
85 INTERACTIVETOOLSFRAMEWORK_API bool IsKeyPressed(FKey InKey) const;
86
91
95 bool bRequireAllKeys = true;
96
97protected:
100
103
104private:
105 void InitializeKeyActivations();
106 bool IsTargetedKey(const FInputDeviceState& Input);
107 bool UpdateActivations(const FInputDeviceState& Input, bool bEmitOnChange);
108 bool IsAnyKeyPressed() const;
109 bool AreAllKeysPressed() const;
110
111 bool bAllKeysSeenPressed = false;
112};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
EInputCaptureSide
Definition InputBehavior.h:20
EInputDevices
Definition InputState.h:30
const bool
Definition NetworkReplayStreaming.h:178
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition InputBehaviorModifierStates.h:19
Definition BehaviorTargetInterfaces.h:41
Definition BehaviorTargetInterfaces.h:15
Definition Array.h:670
Definition AndroidPlatformMisc.h:14
Definition InputBehavior.h:249
Definition KeyInputBehavior.h:46
virtual EInputDevices GetSupportedDevices() override
Definition KeyInputBehavior.h:52
FInputBehaviorModifierStates Modifiers
Definition KeyInputBehavior.h:90
IKeyInputBehaviorTarget * Target
Definition KeyInputBehavior.h:99
TArray< FKey > TargetKeys
Definition KeyInputBehavior.h:101
TArray< bool > KeyActivations
Definition KeyInputBehavior.h:102
Definition Object.h:95
Definition InputBehavior.h:35
Definition InputBehavior.h:67
Definition InputBehavior.h:132
Definition InputState.h:264
Definition InputCoreTypes.h:50