Add new input device processor
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
#include "EnhancedInputComponent.h"
|
||||
#include "Animation/AnimSequenceBase.h"
|
||||
#include "GameFramework/Pawn.h"
|
||||
#include "GameFramework/InputDeviceSubsystem.h"
|
||||
#include "GameFramework/InputSettings.h"
|
||||
|
||||
|
||||
@@ -278,17 +277,3 @@ void UlxUtilityLibrary::ValidateLuaExpr(
|
||||
Status = w.ValidateLuaExpr(Code, ErrorMessage);
|
||||
}
|
||||
|
||||
ElxControllerType UlxUtilityLibrary::DetectControllerType(ULocalPlayer *Player)
|
||||
{
|
||||
UInputDeviceSubsystem *IDS = GEngine->GetEngineSubsystem<UInputDeviceSubsystem>();
|
||||
if (!IDS) return ElxControllerType::KeyboardMouse;
|
||||
|
||||
FName Id = IDS->GetMostRecentlyUsedHardwareDevice(Player->GetPlatformUserId()).HardwareDeviceIdentifier;
|
||||
|
||||
if (Id == TEXT("ps3") || Id == TEXT("ps4") || Id == TEXT("ps5")) return ElxControllerType::PlayStationGamepad;
|
||||
if (Id == TEXT("xbox360") || Id == TEXT("xboxone")) return ElxControllerType::XboxGamepad;
|
||||
|
||||
// Unknown or unrecognized device — assume keyboard/mouse
|
||||
return ElxControllerType::KeyboardMouse;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user