DefaultInputType
DefaultInputType
#Overview
name: DefaultInputType
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 15
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of DefaultInputType is to define the default input method for a specific platform or game project in Unreal Engine 5. It is used to set the initial input type that the game will use when it starts, which can be important for determining how the game interacts with the player’s input devices.
This setting variable is primarily used by the CommonUI plugin and the Core engine module. It is referenced in various subsystems related to input handling, platform-specific settings, and user interface management.
The value of this variable is typically set in the following ways:
- In platform-specific configuration files (INI files)
- Through the UCommonInputPlatformSettings class
- Via the FDataDrivenPlatformInfo structure in the engine’s platform information registry
DefaultInputType interacts with several other variables, including:
- bSupportsMouseAndKeyboard
- bSupportsGamepad
- bCanChangeGamepadType
- bSupportsTouch
Developers should be aware of the following when using this variable:
- The value of DefaultInputType can affect the initial user experience, so it should be set appropriately for the target platform.
- It may need to be adjusted based on the specific input capabilities of the target platform.
- The value can be overridden or changed at runtime if necessary.
Best practices when using this variable include:
- Ensure that the DefaultInputType is consistent with the supported input types for the target platform.
- Consider allowing users to change the input type in-game if multiple input methods are supported.
- Test the game with various input types to ensure a smooth experience across different devices.
- Use the CommonUI plugin’s input system to handle input type changes gracefully throughout the game.
- Keep in mind that this setting may affect UI layout and interaction, so design your UI to be flexible and responsive to different input types.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/Android/DataDrivenPlatformInfo.ini:6, section: [DataDrivenPlatformInfo]
- INI Section:
DataDrivenPlatformInfo
- Raw value:
Touch
- Is Array:
False
Location: <Workspace>/Engine/Config/IOS/DataDrivenPlatformInfo.ini:6, section: [DataDrivenPlatformInfo]
- INI Section:
DataDrivenPlatformInfo
- Raw value:
Touch
- Is Array:
False
Location: <Workspace>/Engine/Config/Linux/DataDrivenPlatformInfo.ini:7, section: [DataDrivenPlatformInfo]
- INI Section:
DataDrivenPlatformInfo
- Raw value:
MouseAndKeyboard
- Is Array:
False
Location: <Workspace>/Engine/Config/LinuxArm64/DataDrivenPlatformInfo.ini:8, section: [DataDrivenPlatformInfo]
- INI Section:
DataDrivenPlatformInfo
- Raw value:
MouseAndKeyboard
- Is Array:
False
Location: <Workspace>/Engine/Config/Mac/DataDrivenPlatformInfo.ini:7, section: [DataDrivenPlatformInfo]
- INI Section:
DataDrivenPlatformInfo
- Raw value:
MouseAndKeyboard
- Is Array:
False
Location: <Workspace>/Engine/Config/Windows/DataDrivenPlatformInfo.ini:13, section: [DataDrivenPlatformInfo]
- INI Section:
DataDrivenPlatformInfo
- Raw value:
MouseAndKeyboard
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/Android/AndroidGame.ini:2, section: [CommonInputPlatformSettings_Android CommonInputPlatformSettings]
- INI Section:
CommonInputPlatformSettings_Android CommonInputPlatformSettings
- Raw value:
Touch
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/IOS/IOSGame.ini:2, section: [CommonInputPlatformSettings_IOS CommonInputPlatformSettings]
- INI Section:
CommonInputPlatformSettings_IOS CommonInputPlatformSettings
- Raw value:
Touch
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/Linux/LinuxGame.ini:2, section: [CommonInputPlatformSettings_Linux CommonInputPlatformSettings]
- INI Section:
CommonInputPlatformSettings_Linux CommonInputPlatformSettings
- Raw value:
MouseAndKeyboard
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/Mac/MacGame.ini:2, section: [CommonInputPlatformSettings_Mac CommonInputPlatformSettings]
- INI Section:
CommonInputPlatformSettings_Mac CommonInputPlatformSettings
- Raw value:
MouseAndKeyboard
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/Windows/WindowsGame.ini:2, section: [CommonInputPlatformSettings_Windows CommonInputPlatformSettings]
- INI Section:
CommonInputPlatformSettings_Windows CommonInputPlatformSettings
- Raw value:
MouseAndKeyboard
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Compositing/Composure/Source/Composure/Classes/CompositingElement.h:153
Scope (from outer to inner):
file
class class ACompositingElement : public AComposurePipelineBaseActor, public ICompImageColorPickerInterface
Source code excerpt:
UPROPERTY(EditDefaultsOnly, Category = "Composure|Editor")
TSubclassOf<UCompositingElementInput> DefaultInputType;
UPROPERTY(EditDefaultsOnly, Category = "Composure|Editor")
TSubclassOf<UCompositingElementTransform> DefaultTransformType;
UPROPERTY(EditDefaultsOnly, Category = "Composure|Editor")
TSubclassOf<UCompositingElementOutput> DefaultOutputType;
#Loc: <Workspace>/Engine/Plugins/Compositing/Composure/Source/Composure/Private/CompositingElement.cpp:228
Scope (from outer to inner):
file
function ACompositingElement::ACompositingElement
Source code excerpt:
}
DefaultInputType = UMediaTextureCompositingInput::StaticClass();//UMediaBundleCompositingInput::StaticClass();
DefaultTransformType = UCompositingElementMaterialPass::StaticClass();
DefaultOutputType = UCompositingMediaCaptureOutput::StaticClass();
#endif
}
void ACompositingElement::SetElementName(const FName NewName)
#Loc: <Workspace>/Engine/Plugins/Compositing/Composure/Source/Composure/Private/EditorSupport/CompositingElementEditorSupport.cpp:140
Scope (from outer to inner):
file
function void ACompositingElement::PostEditChangeProperty
Source code excerpt:
if (!HasAnyFlags(RF_ClassDefaultObject))
{
if (PropertyChangedEvent.ChangeType == EPropertyChangeType::ArrayAdd && DefaultInputType)
{
const int32 AddedIndex = PropertyChangedEvent.GetArrayIndex(PropertyChangedEvent.GetPropertyName().ToString());
if (Inputs.IsValidIndex(AddedIndex))
{
Inputs[AddedIndex] = FCompositingElementPassUtils::NewInstancedSubObj<UCompositingElementInput>(/*Outer =*/this, DefaultInputType);
Inputs[AddedIndex]->PassName = MakeUniqueObjectName(this, UCompositingElementInput::StaticClass(), TEXT("InputPass"));
}
}
else if (PropertyChangedEvent.ChangeType == EPropertyChangeType::ValueSet)
{
const int32 AlteredIndex = PropertyChangedEvent.GetArrayIndex(PropertyChangedEvent.GetPropertyName().ToString());
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Private/CommonInputBaseTypes.cpp:214
Scope (from outer to inner):
file
function UCommonInputPlatformSettings::UCommonInputPlatformSettings
Source code excerpt:
UCommonInputPlatformSettings::UCommonInputPlatformSettings()
{
DefaultInputType = ECommonInputType::Gamepad;
bSupportsMouseAndKeyboard = false;
bSupportsGamepad = true;
bCanChangeGamepadType = true;
bSupportsTouch = false;
DefaultGamepadName = FCommonInputDefaults::GamepadGeneric;
}
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Private/CommonInputBaseTypes.cpp:248
Scope (from outer to inner):
file
function void UCommonInputPlatformSettings::InitializePlatformDefaults
Source code excerpt:
const FName PlatformName = GetPlatformIniName();
const FDataDrivenPlatformInfo& PlatformInfo = FDataDrivenPlatformInfoRegistry::GetPlatformInfo(PlatformName);
if (PlatformInfo.DefaultInputType == "Gamepad")
{
DefaultInputType = ECommonInputType::Gamepad;
}
else if (PlatformInfo.DefaultInputType == "Touch")
{
DefaultInputType = ECommonInputType::Touch;
}
else if (PlatformInfo.DefaultInputType == "MouseAndKeyboard")
{
DefaultInputType = ECommonInputType::MouseAndKeyboard;
}
bSupportsMouseAndKeyboard = PlatformInfo.bSupportsMouseAndKeyboard;
bSupportsGamepad = PlatformInfo.bSupportsGamepad;
bCanChangeGamepadType = PlatformInfo.bCanChangeGamepadType;
bSupportsTouch = PlatformInfo.bSupportsTouch;
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Private/CommonInputSettings.cpp:195
Scope (from outer to inner):
file
function void UCommonInputSettings::PostInitProperties
Source code excerpt:
Settings->bCanChangeGamepadType = OriginalData.bCanChangeGamepadType;
Settings->DefaultGamepadName = OriginalData.DefaultGamepadName;
Settings->DefaultInputType = OriginalData.DefaultInputType;
Settings->ControllerData = OriginalData.ControllerData;
Settings->TryUpdateDefaultConfigFile();
}
else if (PlatformData.Key == FCommonInputDefaults::PlatformPC)
{
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Private/CommonInputSettings.cpp:216
Scope (from outer to inner):
file
function void UCommonInputSettings::PostInitProperties
Source code excerpt:
PCPlatform->bCanChangeGamepadType = OriginalData.bCanChangeGamepadType;
PCPlatform->DefaultGamepadName = OriginalData.DefaultGamepadName;
PCPlatform->DefaultInputType = OriginalData.DefaultInputType;
PCPlatform->ControllerData = OriginalData.ControllerData;
PCPlatform->TryUpdateDefaultConfigFile();
}
}
}
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Public/CommonInputBaseTypes.h:228
Scope (from outer to inner):
file
class class UCommonInputPlatformSettings : public UPlatformSettings
function ECommonInputType GetDefaultInputType
Source code excerpt:
ECommonInputType GetDefaultInputType() const
{
return DefaultInputType;
}
bool SupportsInputType(ECommonInputType InputType) const;
const FName GetDefaultGamepadName() const
{
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Public/CommonInputBaseTypes.h:258
Scope (from outer to inner):
file
class class UCommonInputPlatformSettings : public UPlatformSettings
Source code excerpt:
UPROPERTY(config, EditAnywhere, Category = "Default")
ECommonInputType DefaultInputType;
UPROPERTY(config, EditAnywhere, Category = "Default")
bool bSupportsMouseAndKeyboard;
UPROPERTY(config, EditAnywhere, Category = "Default")
bool bSupportsTouch;
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Public/CommonInputBaseTypes.h:293
Scope (from outer to inner):
file
function FCommonInputPlatformBaseData
Source code excerpt:
FCommonInputPlatformBaseData()
{
DefaultInputType = ECommonInputType::Gamepad;
bSupportsMouseAndKeyboard = false;
bSupportsGamepad = true;
bCanChangeGamepadType = true;
bSupportsTouch = false;
DefaultGamepadName = FCommonInputDefaults::GamepadGeneric;
}
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Public/CommonInputBaseTypes.h:308
Scope (from outer to inner):
file
function ECommonInputType GetDefaultInputType
Source code excerpt:
ECommonInputType GetDefaultInputType() const
{
return DefaultInputType;
};
bool SupportsInputType(ECommonInputType InputType) const
{
switch (InputType)
{
#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Public/CommonInputBaseTypes.h:353
Scope: file
Source code excerpt:
protected:
UPROPERTY(EditDefaultsOnly, Category = "Properties")
ECommonInputType DefaultInputType;
UPROPERTY(EditDefaultsOnly, Category = "Properties")
bool bSupportsMouseAndKeyboard;
UPROPERTY(EditDefaultsOnly, Category = "Gamepad")
bool bSupportsGamepad;
#Loc: <Workspace>/Engine/Plugins/Runtime/GameInput/Source/GameInputBase/Private/GameInputDeveloperSettings.cpp:102
Scope (from outer to inner):
file
function void UGameInputPlatformSettings::InitializePlatformDefaults
Source code excerpt:
const FName PlatformName = GetPlatformIniName();
const FDataDrivenPlatformInfo& PlatformInfo = FDataDrivenPlatformInfoRegistry::GetPlatformInfo(PlatformName);
if (PlatformInfo.DefaultInputType == "MouseAndKeyboard")
{
bProcessKeyboard = false;
bProcessMouse = false;
// We also want to disable gamepad processing by default here, because it is likely that your PC platform
// will be using the existing Xinput implementation. If one day we can turn off XInput by default,
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Misc/DataDrivenPlatformInfoRegistry.cpp:355
Scope (from outer to inner):
file
function static void LoadDDPIIniSettings
Source code excerpt:
DDPIGetBool(IniFile, TEXT("bInputSupportConfigurable"), Info.bInputSupportConfigurable);
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);
#Loc: <Workspace>/Engine/Source/Runtime/Core/Public/Misc/DataDrivenPlatformInfoRegistry.h:153
Scope: file
Source code excerpt:
// Input-related settings
bool bInputSupportConfigurable = false;
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