10#include "InputComponent.generated.h"
15template<
class DelegateType,
class DynamicDelegateType>
50 template<
class UserClass >
102template<
class DelegateType,
class DynamicDelegateType>
105template<
class DelegateType,
class DynamicDelegateType>
139 switch (BoundDelegateType)
141 case EBoundDelegate::Delegate:
142 return FuncDelegate->IsBound();
144 case EBoundDelegate::DelegateWithKey:
145 return FuncDelegateWithKey->IsBound();
147 case EBoundDelegate::DynamicDelegate:
148 return FuncDynDelegate->IsBound();
157 switch (BoundDelegateType)
159 case EBoundDelegate::Delegate:
160 return (FuncDelegate->IsBound() && FuncDelegate->IsBoundToObject(
Object));
162 case EBoundDelegate::DelegateWithKey:
163 return (FuncDelegateWithKey->IsBound() && FuncDelegateWithKey->IsBoundToObject(
Object));
165 case EBoundDelegate::DynamicDelegate:
166 return (FuncDynDelegate->IsBound() && FuncDynDelegate->IsBoundToObject(
Object));
175 switch (BoundDelegateType)
177 case EBoundDelegate::Delegate:
178 return FuncDelegate->GetUObject();
180 case EBoundDelegate::DelegateWithKey:
181 return FuncDelegateWithKey->GetUObject();
183 case EBoundDelegate::DynamicDelegate:
184 return FuncDynDelegate->GetUObject();
193 switch (BoundDelegateType)
195 case EBoundDelegate::Delegate:
196 return FuncDelegate->GetObjectForTimerManager();
198 case EBoundDelegate::DelegateWithKey:
199 return FuncDelegateWithKey->GetObjectForTimerManager();
201 case EBoundDelegate::DynamicDelegate:
202 return FuncDynDelegate->GetUObject();
209 template<
class UserClass >
213 BoundDelegateType = EBoundDelegate::Delegate;
217 template<
class UserClass >
221 BoundDelegateType = EBoundDelegate::DelegateWithKey;
225 template<
class DelegateType,
class UserClass,
typename...
VarTypes >
229 BoundDelegateType = EBoundDelegate::Delegate;
237 BoundDelegateType = EBoundDelegate::DynamicDelegate;
239 FuncDynDelegate->BindUFunction(
Object, FuncName);
246 BoundDelegateType = EBoundDelegate::Delegate;
248 return *FuncDelegate;
255 BoundDelegateType = EBoundDelegate::DelegateWithKey;
257 return *FuncDelegateWithKey;
263 switch(BoundDelegateType)
265 case EBoundDelegate::Delegate:
266 FuncDelegate->Unbind();
269 case EBoundDelegate::DelegateWithKey:
270 FuncDelegateWithKey->Unbind();
273 case EBoundDelegate::DynamicDelegate:
274 FuncDynDelegate->Unbind();
277 BoundDelegateType = EBoundDelegate::Unbound;
283 switch(BoundDelegateType)
285 case EBoundDelegate::Delegate:
286 if (FuncDelegate->IsBound())
288 FuncDelegate->Execute();
292 case EBoundDelegate::DelegateWithKey:
293 if (FuncDelegateWithKey->IsBound())
295 FuncDelegateWithKey->Execute(Key);
299 case EBoundDelegate::DynamicDelegate:
300 if (FuncDynDelegate->IsBound())
302 FuncDynDelegate->Execute(Key);
315 enum class EBoundDelegate :
uint8
323 EBoundDelegate BoundDelegateType;
418 inline void Execute(
const ETouchIndex::Type FingerIndex,
const FVector Location)
const
471 inline void Execute(
const float AxisValue)
const
711 : PlayerInput(
nullptr)
712 , KeyMapBuiltForIndex(0)
821 ENGINE_API virtual void ClearActionBindings();
872 template<
class UserClass>
877 return AddActionBinding(
MoveTemp(AB));
884 template<
class UserClass>
889 return AddActionBinding(
MoveTemp(AB));
896 template<
class DelegateType,
class UserClass,
typename...
VarTypes >
901 return AddActionBinding(
MoveTemp(AB));
908 template<
class UserClass>
911 LogDeprecatedBindingWarning(AxisName);
916 return AxisBindings.
Last();
938 LogDeprecatedBindingWarning(AxisName);
942 return AxisBindings.
Last();
949 template<
class UserClass>
955 return AxisKeyBindings.
Last();
967 return AxisKeyBindings.
Last();
981 template<
class UserClass>
987 return VectorAxisBindings.
Last();
999 return VectorAxisBindings.
Last();
1006 template<
class UserClass>
1010 KB.KeyDelegate.BindDelegate(
Object, Func);
1012 return KeyBindings.
Last();
1019 template<
class UserClass>
1022 return BindKey(
FInputChord(Key,
false,
false,
false,
false), KeyEvent,
Object, Func);
1029 template <
class UserClass>
1033 KB.KeyDelegate.BindDelegate(
Object, Func);
1035 return KeyBindings.
Last();
1042 template<
class UserClass>
1046 TB.TouchDelegate.BindDelegate(
Object, Func);
1048 return TouchBindings.
Last();
1055 template<
class UserClass>
1059 GB.GestureDelegate.BindDelegate(
Object, Func);
1061 return GestureBindings.
Last();
1079 UFUNCTION(BlueprintCallable, meta=(DeprecatedFunction, DeprecationMessage=
"Use PlayerController.IsInputKeyDown instead."))
1083 UFUNCTION(BlueprintCallable, meta=(DeprecatedFunction, DeprecationMessage="Use PlayerController.WasInputKeyJustPressed
instead."))
1087 UFUNCTION(BlueprintCallable, meta=(DeprecatedFunction, DeprecationMessage="Use PlayerController.WasInputKeyJustReleased
instead."))
1091 UFUNCTION(BlueprintCallable, meta=(DeprecatedFunction, DeprecationMessage="Use PlayerController.GetInputAnalogKeyState
instead."))
1095 UFUNCTION(BlueprintCallable, meta=(DeprecatedFunction, DeprecationMessage="Use PlayerController.GetInputVectorKeyState
instead."))
1099 UFUNCTION(BlueprintCallable, meta=(DeprecatedFunction, DeprecationMessage="Use PlayerController.GetInputTouchState
instead."))
1103 UFUNCTION(BlueprintCallable, meta=(DeprecatedFunction, DeprecationMessage="Use PlayerController.GetInputKeyTimeDown
instead."))
1107 UFUNCTION(BlueprintCallable, meta=(DeprecatedFunction, DeprecationMessage="Use PlayerController.GetInputMouseDelta
instead."))
1108 ENGINE_API void GetControllerMouseDelta(
float& DeltaX,
float& DeltaY) const;
1111 UFUNCTION(BlueprintCallable, meta=(DeprecatedFunction, DeprecationMessage="Use PlayerController.GetInputAnalogStickState
instead."))
1122 InputComponent->GetActionsBoundToKey(PlayerInput, Key, Actions);
#define ensure( InExpression)
Definition AssertionMacros.h:464
@ INDEX_NONE
Definition CoreMiscDefines.h:150
TSharedRef< InObjectType, InMode > MakeShared(InArgTypes &&... Args)
Definition SharedPointer.h:2009
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_DELEGATE(DelegateName)
Definition DelegateCombinations.h:20
#define DECLARE_DELEGATE_TwoParams(DelegateName, Param1Type, Param2Type)
Definition DelegateCombinations.h:57
#define DECLARE_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:48
#define DECLARE_DYNAMIC_DELEGATE_OneParam(DelegateName, Param1Type, Param1Name)
Definition DelegateCombinations.h:52
#define DECLARE_DYNAMIC_DELEGATE_TwoParams(DelegateName, Param1Type, Param1Name, Param2Type, Param2Name)
Definition DelegateCombinations.h:61
EInputEvent
Definition EngineBaseTypes.h:31
@ IE_Pressed
Definition EngineBaseTypes.h:32
return true
Definition ExternalRpcRegistry.cpp:601
const void * FDelegateUserObjectConst
Definition IDelegateInstance.h:108
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition NameTypes.h:617
Definition UnrealType.h:3087
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT ElementType & Last(SizeType IndexFromTheEnd=0) UE_LIFETIMEBOUND
Definition Array.h:1263
UE_FORCEINLINE_HINT SizeType Emplace(ArgsType &&... Args)
Definition Array.h:2561
Definition EnumAsByte.h:22
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
UE_FORCEINLINE_HINT void Reset()
Definition SharedPointer.h:1120
UE_FORCEINLINE_HINT const bool IsValid() const
Definition SharedPointer.h:1085
Definition ActorComponent.h:152
#define KB
Definition lz4.cpp:242
#define GB
Definition lz4.cpp:244
Definition InputComponent.h:680
Type
Definition InputComponent.h:682
@ CAS_LeftStick
Definition InputComponent.h:683
@ CAS_MAX
Definition InputComponent.h:685
@ CAS_RightStick
Definition InputComponent.h:684
Type
Definition EngineTypes.h:3431
@ false
Definition radaudio_common.h:23
Definition InputComponent.h:694
Definition InputComponent.h:1118
Definition InputCoreTypes.h:50
INPUTCORE_API bool IsAxis3D() const
Definition InputCoreTypes.cpp:1356
INPUTCORE_API bool IsAxis1D() const
Definition InputCoreTypes.cpp:1344
INPUTCORE_API bool IsAxis2D() const
Definition InputCoreTypes.cpp:1350
Definition WeakObjectPtrTemplates.h:25