UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GestureDetector.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
6#include "HAL/Platform.h"
7#include "InputCoreTypes.h"
8#include "Math/Vector2D.h"
9#include "Misc/Optional.h"
10
12
18{
19public:
21 static double LongPressSeconds;
22
28
29public:
33 static bool IsGestureSupported(EGestureEvent Gesture);
34
35 void OnTouchStarted(int32 TouchIndex, const FVector2D& Location);
36 void OnTouchEnded(int32 TouchIndex, const FVector2D& Location);
37 void OnTouchMoved(int32 TouchIndex, const FVector2D& Location);
38
43
44private:
45 struct FLongPressData
46 {
48 FVector2D Location;
49
50 FLongPressData()
51 : Time()
52 , Location(0, 0)
53 {
54 }
55
56 void Reset()
57 {
58 Time.Reset();
59 Location = FVector2D(0, 0);
60 }
61 };
62
63 FLongPressData LongPressTrack[EKeys::NUM_TOUCH_KEYS];
64};
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
EGestureEvent
Definition GenericApplicationMessageHandler.h:138
UE::Math::TVector2< double > FVector2D
Definition MathFwd.h:48
Definition ContainerAllocationPolicies.h:1644
Definition GenericApplicationMessageHandler.h:209
Definition GestureDetector.h:18
static bool IsGestureSupported(EGestureEvent Gesture)
Definition GestureDetector.cpp:8
static double LongPressSeconds
Definition GestureDetector.h:21
void GenerateGestures(FGenericApplicationMessageHandler &MessageHandler, const TBitArray< FDefaultBitArrayAllocator > &EnabledGestures)
Definition GestureDetector.cpp:49
static float LongPressAllowedMovement
Definition GestureDetector.h:27
void OnTouchStarted(int32 TouchIndex, const FVector2D &Location)
Definition GestureDetector.cpp:19
void OnTouchMoved(int32 TouchIndex, const FVector2D &Location)
Definition GestureDetector.cpp:37
void OnTouchEnded(int32 TouchIndex, const FVector2D &Location)
Definition GestureDetector.cpp:29
Definition BitArray.h:350
static const int32 NUM_TOUCH_KEYS
Definition InputCoreTypes.h:695
Definition Optional.h:131