bSupportsGamepad
bSupportsGamepad
#Overview
name: bSupportsGamepad
The value of this variable can be defined or overridden in .ini config files. 11
.ini config files referencing this setting variable.
It is referenced in 11
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bSupportsGamepad is to indicate whether the current platform or input settings support gamepad input. This variable is used to determine the availability and configuration of gamepad controls within the Unreal Engine’s input system.
This setting variable is primarily used by the CommonUI plugin, specifically within the CommonInput module. It is also referenced in the Core module of Unreal Engine.
The value of this variable is typically set in several places:
- In the UCommonInputPlatformSettings constructor
- During the initialization of platform defaults in UCommonInputPlatformSettings::InitializePlatformDefaults()
- In configuration files loaded by the DataDrivenPlatformInfoRegistry
bSupportsGamepad interacts with other input-related variables such as bSupportsMouseAndKeyboard, bSupportsTouch, and bCanChangeGamepadType. These variables collectively define the input capabilities of the platform.
Developers should be aware that this variable affects the availability of gamepad input in their game. If set to false, gamepad input may be disabled or ignored by the engine’s input system.
Best practices when using this variable include:
- Ensuring it’s correctly set for each target platform
- Using it in conjunction with other input type support variables to provide a comprehensive input experience
- Checking its value before attempting to use gamepad-specific input features
- Considering it when designing UI and control schemes to ensure proper support across different input types
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/Android/DataDrivenPlatformInfo.ini:8, section: [DataDrivenPlatformInfo]
- INI Section:
DataDrivenPlatformInfo
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/IOS/DataDrivenPlatformInfo.ini:8, section: [DataDrivenPlatformInfo]
- INI Section:
DataDrivenPlatformInfo
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/Linux/DataDrivenPlatformInfo.ini:9, section: [DataDrivenPlatformInfo]
- INI Section:
DataDrivenPlatformInfo
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/LinuxArm64/DataDrivenPlatformInfo.ini:10, section: [DataDrivenPlatformInfo]
- INI Section:
DataDrivenPlatformInfo
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/Mac/DataDrivenPlatformInfo.ini:9, section: [DataDrivenPlatformInfo]
- INI Section:
DataDrivenPlatformInfo
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/Windows/DataDrivenPlatformInfo.ini:15, section: [DataDrivenPlatformInfo]
- INI Section:
DataDrivenPlatformInfo
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/Android/AndroidGame.ini:4, section: [CommonInputPlatformSettings_Android CommonInputPlatformSettings]
- INI Section:
CommonInputPlatformSettings_Android CommonInputPlatformSettings
- Raw value:
True
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/IOS/IOSGame.ini:5, section: [CommonInputPlatformSettings_IOS CommonInputPlatformSettings]
- INI Section:
CommonInputPlatformSettings_IOS CommonInputPlatformSettings
- Raw value:
True
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/Linux/LinuxGame.ini:5, section: [CommonInputPlatformSettings_Linux CommonInputPlatformSettings]
- INI Section:
CommonInputPlatformSettings_Linux CommonInputPlatformSettings
- Raw value:
True
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/Mac/MacGame.ini:5, section: [CommonInputPlatformSettings_Mac CommonInputPlatformSettings]
- INI Section:
CommonInputPlatformSettings_Mac CommonInputPlatformSettings
- Raw value:
True
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/Windows/WindowsGame.ini:5, section: [CommonInputPlatformSettings_Windows CommonInputPlatformSettings]
- INI Section:
CommonInputPlatformSettings_Windows CommonInputPlatformSettings
- Raw value:
True
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Private/CommonInputBaseTypes.cpp:216
Scope (from outer to inner):
file
function UCommonInputPlatformSettings::UCommonInputPlatformSettings
Source code excerpt:
DefaultInputType = ECommonInputType::Gamepad;
bSupportsMouseAndKeyboard = false;
bSupportsGamepad = true;
bCanChangeGamepadType = true;
bSupportsTouch = false;
DefaultGamepadName = FCommonInputDefaults::GamepadGeneric;
}
void UCommonInputPlatformSettings::PostLoad()
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Private/CommonInputBaseTypes.cpp:262
Scope (from outer to inner):
file
function void UCommonInputPlatformSettings::InitializePlatformDefaults
Source code excerpt:
bSupportsMouseAndKeyboard = PlatformInfo.bSupportsMouseAndKeyboard;
bSupportsGamepad = PlatformInfo.bSupportsGamepad;
bCanChangeGamepadType = PlatformInfo.bCanChangeGamepadType;
bSupportsTouch = PlatformInfo.bSupportsTouch;
DefaultGamepadName = PlatformName;
}
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Private/CommonInputBaseTypes.cpp:363
Scope (from outer to inner):
file
function bool UCommonInputPlatformSettings::SupportsInputType
Source code excerpt:
case ECommonInputType::Gamepad:
{
return bSupportsGamepad;
}
break;
case ECommonInputType::Touch:
{
return bSupportsTouch;
}
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Private/CommonInputSettings.cpp:191
Scope (from outer to inner):
file
function void UCommonInputSettings::PostInitProperties
Source code excerpt:
{
Settings->bSupportsMouseAndKeyboard = OriginalData.bSupportsMouseAndKeyboard;
Settings->bSupportsGamepad = OriginalData.bSupportsGamepad;
Settings->bSupportsTouch = OriginalData.bSupportsTouch;
Settings->bCanChangeGamepadType = OriginalData.bCanChangeGamepadType;
Settings->DefaultGamepadName = OriginalData.DefaultGamepadName;
Settings->DefaultInputType = OriginalData.DefaultInputType;
Settings->ControllerData = OriginalData.ControllerData;
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Private/CommonInputSettings.cpp:212
Scope (from outer to inner):
file
function void UCommonInputSettings::PostInitProperties
Source code excerpt:
{
PCPlatform->bSupportsMouseAndKeyboard = OriginalData.bSupportsMouseAndKeyboard;
PCPlatform->bSupportsGamepad = OriginalData.bSupportsGamepad;
PCPlatform->bSupportsTouch = OriginalData.bSupportsTouch;
PCPlatform->bCanChangeGamepadType = OriginalData.bCanChangeGamepadType;
PCPlatform->DefaultGamepadName = OriginalData.DefaultGamepadName;
PCPlatform->DefaultInputType = OriginalData.DefaultInputType;
PCPlatform->ControllerData = OriginalData.ControllerData;
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Public/CommonInputBaseTypes.h:267
Scope (from outer to inner):
file
class class UCommonInputPlatformSettings : public UPlatformSettings
Source code excerpt:
UPROPERTY(config, EditAnywhere, Category = "Default")
bool bSupportsGamepad;
UPROPERTY(config, EditAnywhere, Category = "Default", Meta = (EditCondition = "bSupportsGamepad"))
FName DefaultGamepadName;
UPROPERTY(config, EditAnywhere, Category = "Default", Meta = (EditCondition = "bSupportsGamepad"))
bool bCanChangeGamepadType;
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Public/CommonInputBaseTypes.h:295
Scope (from outer to inner):
file
function FCommonInputPlatformBaseData
Source code excerpt:
DefaultInputType = ECommonInputType::Gamepad;
bSupportsMouseAndKeyboard = false;
bSupportsGamepad = true;
bCanChangeGamepadType = true;
bSupportsTouch = false;
DefaultGamepadName = FCommonInputDefaults::GamepadGeneric;
}
virtual ~FCommonInputPlatformBaseData() = default;
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Public/CommonInputBaseTypes.h:322
Scope (from outer to inner):
file
function bool SupportsInputType
Source code excerpt:
case ECommonInputType::Gamepad:
{
return bSupportsGamepad;
}
break;
case ECommonInputType::Touch:
{
return bSupportsTouch;
}
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Public/CommonInputBaseTypes.h:359
Scope: file
Source code excerpt:
UPROPERTY(EditDefaultsOnly, Category = "Gamepad")
bool bSupportsGamepad;
UPROPERTY(EditDefaultsOnly, Category = "Gamepad", Meta = (EditCondition = "bSupportsGamepad"))
FName DefaultGamepadName;
UPROPERTY(EditDefaultsOnly, Category = "Gamepad", Meta = (EditCondition = "bSupportsGamepad"))
bool bCanChangeGamepadType;
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Misc/DataDrivenPlatformInfoRegistry.cpp:357
Scope (from outer to inner):
file
function static void LoadDDPIIniSettings
Source code excerpt:
DDPIGetString(IniFile, TEXT("DefaultInputType"), Info.DefaultInputType);
DDPIGetBool(IniFile, TEXT("bSupportsMouseAndKeyboard"), Info.bSupportsMouseAndKeyboard);
DDPIGetBool(IniFile, TEXT("bSupportsGamepad"), Info.bSupportsGamepad);
DDPIGetBool(IniFile, TEXT("bCanChangeGamepadType"), Info.bCanChangeGamepadType);
DDPIGetBool(IniFile, TEXT("bSupportsTouch"), Info.bSupportsTouch);
DDPIGetName(IniFile, TEXT("OverrideCookPlatformName"), Info.OverrideCookPlatformName);
#if DDPI_HAS_EXTENDED_PLATFORMINFO_DATA
#Loc: <Workspace>/Engine/Source/Runtime/Core/Public/Misc/DataDrivenPlatformInfoRegistry.h:155
Scope: file
Source code excerpt:
FString DefaultInputType = "Gamepad";
bool bSupportsMouseAndKeyboard = false;
bool bSupportsGamepad = true;
bool bCanChangeGamepadType = true;
bool bSupportsTouch = false;
// the compression format that this platform wants; overrides game unless bForceUseProjectCompressionFormat
FString HardwareCompressionFormat;