UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AppleControllerInterface.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"
6#include "Misc/CoreMisc.h"
9#import <GameController/GameController.h>
10
12
22
32
40
59
64{
65public:
66
69
70public:
71
73
75
77 void Tick( float DeltaTime );
78
83
87 virtual void SetForceFeedbackChannelValue(int32 ControllerId, FForceFeedbackChannelType ChannelType, float Value) override {}
88 virtual void SetForceFeedbackChannelValues(int32 ControllerId, const FForceFeedbackValues &values) override {}
89 virtual void SetLightColor(int32 ControllerId, FColor Color) override {}
90 virtual void ResetLightColor(int32 ControllerId) override {}
91
92 bool IsControllerAssignedToGamepad(int32 ControllerId) const;
93 bool IsGamepadAttached() const;
94
98
100
105
106protected:
107
109
111
112private:
113
114 void HandleConnection(GCController* Controller);
115 void HandleDisconnect(GCController* Controller);
116
117 void SetCurrentController(GCController* Controller);
118
119protected:
120
122
123
142
143 // Controller Event Callbacks are on the main thread - defer to tick processing
146
147 // there is a hardcoded limit of 4 controllers in the API
149
151
152 // should we allow controllers to send input
154
156};
EGLSurface EGLint const EGLint EGLnsecsANDROID * values
Definition AndroidOpenGLFunctions.h:11
ControllerType
Definition AppleControllerInterface.h:14
@ DualSenseGamepad
Definition AppleControllerInterface.h:20
@ DualShockGamepad
Definition AppleControllerInterface.h:19
@ SiriRemote
Definition AppleControllerInterface.h:16
@ Unassigned
Definition AppleControllerInterface.h:15
@ ExtendedGamepad
Definition AppleControllerInterface.h:17
@ XboxGamepad
Definition AppleControllerInterface.h:18
PlayerIndex
Definition AppleControllerInterface.h:24
@ PlayerFour
Definition AppleControllerInterface.h:28
@ PlayerThree
Definition AppleControllerInterface.h:27
@ PlayerUnset
Definition AppleControllerInterface.h:30
@ PlayerTwo
Definition AppleControllerInterface.h:26
@ PlayerOne
Definition AppleControllerInterface.h:25
EAppleControllerEventType
Definition AppleControllerInterface.h:34
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
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
FForceFeedbackChannelType
Definition IInputInterface.h:17
#define DECLARE_LOG_CATEGORY_EXTERN(CategoryName, DefaultVerbosity, CompileTimeVerbosity)
Definition LogMacros.h:361
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition AppleControllerInterface.h:64
bool bAllowControllers
Definition AppleControllerInterface.h:153
FCriticalSection DeferredEventCS
Definition AppleControllerInterface.h:144
TSharedRef< FGenericApplicationMessageHandler > MessageHandler
Definition AppleControllerInterface.h:121
const ControllerType GetControllerType(uint32 ControllerIndex)
Definition AppleControllerInterface.cpp:416
TArray< FDeferredAppleControllerEvent > DeferredEvents
Definition AppleControllerInterface.h:145
void SetControllerType(uint32 ControllerIndex)
Definition AppleControllerInterface.cpp:120
FName GetControllerTypeName(const ControllerType InControllerType)
Definition AppleControllerInterface.cpp:169
virtual void SetForceFeedbackChannelValues(int32 ControllerId, const FForceFeedbackValues &values) override
Definition AppleControllerInterface.h:88
void SignalEvent(EAppleControllerEventType InEventType, GCController *InController)
Definition AppleControllerInterface.cpp:78
virtual void SetForceFeedbackChannelValue(int32 ControllerId, FForceFeedbackChannelType ChannelType, float Value) override
Definition AppleControllerInterface.h:87
virtual void ResetLightColor(int32 ControllerId) override
Definition AppleControllerInterface.h:90
virtual void SetLightColor(int32 ControllerId, FColor Color) override
Definition AppleControllerInterface.h:89
FUserController Controllers[4]
Definition AppleControllerInterface.h:148
bool IsControllerAssignedToGamepad(int32 ControllerId) const
Definition AppleControllerInterface.cpp:377
TMap< FName, double > NextKeyRepeatTime
Definition AppleControllerInterface.h:150
static TSharedPtr< FAppleControllerInterface > Get()
bool IsGamepadAttached() const
Definition AppleControllerInterface.cpp:383
GCControllerButtonInput * GetGCControllerButton(const FGamepadKeyNames::Type &ButtonKey, uint32 ControllerIndex)
Definition AppleControllerInterface.cpp:393
void SendControllerEvents()
Definition AppleControllerInterface.cpp:302
void HandleButtonGamepad(const FGamepadKeyNames::Type &UEButton, uint32 ControllerIndex)
Definition AppleControllerInterface.cpp:515
void SetMessageHandler(const TSharedRef< FGenericApplicationMessageHandler > &InMessageHandler)
Definition AppleControllerInterface.cpp:73
void HandleAnalogGamepad(const FGamepadKeyNames::Type &UEAxis, uint32 ControllerIndex)
Definition AppleControllerInterface.cpp:594
static FString HardwareDeviceIdentifier_DefaultGamepad
Definition AppleControllerInterface.h:155
virtual ~FAppleControllerInterface()
Definition AppleControllerInterface.h:72
void HandleVirtualButtonGamepad(const FGamepadKeyNames::Type &UEButtonNegative, const FGamepadKeyNames::Type &UEButtonPositive, uint32 ControllerIndex)
Definition AppleControllerInterface.cpp:459
void HandleInputInternal(const FGamepadKeyNames::Type &UEButton, uint32 ControllerIndex, bool bIsPressed, bool bWasPressed)
Definition AppleControllerInterface.cpp:425
Definition NameTypes.h:617
Definition IInputInterface.h:309
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition SharedPointer.h:153
Definition AppleControllerInterface.h:126
PlayerIndex PlayerIndex
Definition AppleControllerInterface.h:131
GCMicroGamepad * PreviousMicroGamepad
Definition AppleControllerInterface.h:134
bool bNeedsReferenceAttitude
Definition AppleControllerInterface.h:138
GCController * Controller
Definition AppleControllerInterface.h:127
FQuat ReferenceAttitude
Definition AppleControllerInterface.h:137
GCExtendedGamepad * PreviousExtendedGamepad
Definition AppleControllerInterface.h:133
ControllerType ControllerType
Definition AppleControllerInterface.h:129
bool bHasReferenceAttitude
Definition AppleControllerInterface.h:139
Definition Color.h:486
Definition AppleControllerInterface.h:42
FDeferredAppleControllerEvent(const FDeferredAppleControllerEvent &Other)
Definition AppleControllerInterface.h:47
EAppleControllerEventType EventType
Definition AppleControllerInterface.h:56
~FDeferredAppleControllerEvent()
Definition AppleControllerInterface.h:52
GCController * Controller
Definition AppleControllerInterface.h:57
FDeferredAppleControllerEvent(EAppleControllerEventType InEventType, GCController *InController)
Definition AppleControllerInterface.h:43
Definition IInputInterface.h:26