bDefaultInputStandardKeyboard

bDefaultInputStandardKeyboard

#Overview

name: bDefaultInputStandardKeyboard

The value of this variable can be defined or overridden in .ini config files. 4 .ini config files referencing this setting variable.

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bDefaultInputStandardKeyboard is to indicate whether a platform uses a standard keyboard layout as its default input method. This setting is part of the input system configuration in Unreal Engine 5.

This setting variable is primarily used by the CommonUI plugin, specifically in the CommonInput module, as well as the Core module of Unreal Engine. It helps determine how input should be handled across different platforms.

The value of this variable is set in the platform-specific configuration files, loaded through the DataDrivenPlatformInfoRegistry. It’s read from an INI file using the DDPIGetBool function.

bDefaultInputStandardKeyboard interacts with other input-related variables such as bHasDedicatedGamepad, bInputSupportConfigurable, DefaultInputType, bSupportsMouseAndKeyboard, bSupportsGamepad, and bCanChangeGamepadType. These variables collectively define the input characteristics of a platform.

Developers must be aware that this variable is used to differentiate platforms that use a standard keyboard (like Windows and Linux) from those that don’t (like macOS). It’s crucial for determining how to handle input across different platforms, especially when developing cross-platform games.

Best practices when using this variable include:

  1. Ensure that platform-specific INI files are correctly configured for each target platform.
  2. Use this variable in conjunction with other input-related settings to create a comprehensive input strategy for your game.
  3. Be mindful of how this setting affects platform detection and input handling, especially when supporting multiple platforms.
  4. When developing UI or input systems, consider how this variable might impact the user experience across different platforms.
  5. Regularly test your game on various platforms to ensure that input is handled correctly based on this and related settings.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/Linux/DataDrivenPlatformInfo.ini:5, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/LinuxArm64/DataDrivenPlatformInfo.ini:6, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/Mac/DataDrivenPlatformInfo.ini:5, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/Windows/DataDrivenPlatformInfo.ini:11, section: [DataDrivenPlatformInfo]

#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:150

Scope (from outer to inner):

file
function     const TArray<FName>& UCommonInputBaseControllerData::GetRegisteredGamepads
lambda-function

Source code excerpt:

			// If the platform uses the standard keyboard for default input, ignore it, all of those platforms will use "PC"
			// as their target, so Windows, Linux, but not Mac.
			if (PlatformInfo.bDefaultInputStandardKeyboard)
			{
				continue;
			}

			// Only add platforms with dedicated gamepads.
			if (PlatformInfo.bHasDedicatedGamepad)

#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Private/CommonInputBaseTypes.cpp:445

Scope (from outer to inner):

file
function     const TArray<FName>& FCommonInputPlatformBaseData::GetRegisteredPlatforms
lambda-function

Source code excerpt:

			// If the platform uses the standard keyboard for default input, ignore it, all of those platforms will use "PC"
			// as their target, so Windows, Linux, but not Mac.
			if (PlatformInfo.bDefaultInputStandardKeyboard)
			{
				continue;
			}

			RegisteredPlatforms.Add(PlatformName);
		}

#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Misc/DataDrivenPlatformInfoRegistry.cpp:352

Scope (from outer to inner):

file
function     static void LoadDDPIIniSettings

Source code excerpt:

	// NOTE: add more settings here!
	DDPIGetBool(IniFile, TEXT("bHasDedicatedGamepad"), Info.bHasDedicatedGamepad);
	DDPIGetBool(IniFile, TEXT("bDefaultInputStandardKeyboard"), Info.bDefaultInputStandardKeyboard);

	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);

#Loc: <Workspace>/Engine/Source/Runtime/Core/Public/Misc/DataDrivenPlatformInfoRegistry.h:149

Scope: file

Source code excerpt:


	// True if this platform handles input via standard keyboard layout by default, translates to PC platform
	bool bDefaultInputStandardKeyboard = false;

	// Input-related settings
	bool bInputSupportConfigurable = false;
	FString DefaultInputType = "Gamepad";
	bool bSupportsMouseAndKeyboard = false;
	bool bSupportsGamepad = true;