bSupportsMouseAndKeyboard

bSupportsMouseAndKeyboard

#Overview

name: bSupportsMouseAndKeyboard

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 bSupportsMouseAndKeyboard is to indicate whether a platform supports mouse and keyboard input in the Unreal Engine 5 input system. This setting variable is primarily used for managing input types across different platforms in the Common UI plugin.

The Common UI plugin, specifically the CommonInput module, relies heavily on this setting variable. It is used in the UCommonInputPlatformSettings and UCommonInputSettings classes to determine input support for various platforms.

The value of this variable is typically set in several ways:

  1. In the default constructor of UCommonInputPlatformSettings
  2. During the initialization of platform defaults in UCommonInputPlatformSettings::InitializePlatformDefaults
  3. In the PostInitProperties function of UCommonInputSettings
  4. It can also be set through configuration files, as indicated by the UPROPERTY(config) attribute

This variable interacts with other input-related variables such as bSupportsGamepad, bSupportsTouch, and DefaultInputType. Together, these variables define the input capabilities of a platform.

Developers must be aware that this variable affects the behavior of input-related functions, such as SupportsInputType. Changing this variable can impact how the game responds to different input methods on various platforms.

Best practices when using this variable include:

  1. Ensuring it is correctly set for each target platform
  2. Using it in conjunction with other input-related variables for a comprehensive input strategy
  3. Considering its value when designing UI and gameplay elements that require specific input types
  4. Updating it appropriately if the game’s input support changes during development

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/Android/DataDrivenPlatformInfo.ini:7, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/IOS/DataDrivenPlatformInfo.ini:7, section: [DataDrivenPlatformInfo]

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

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

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

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

Location: <Workspace>/Projects/Lyra/Config/Android/AndroidGame.ini:3, section: [CommonInputPlatformSettings_Android CommonInputPlatformSettings]

Location: <Workspace>/Projects/Lyra/Config/IOS/IOSGame.ini:3, section: [CommonInputPlatformSettings_IOS CommonInputPlatformSettings]

Location: <Workspace>/Projects/Lyra/Config/Linux/LinuxGame.ini:3, section: [CommonInputPlatformSettings_Linux CommonInputPlatformSettings]

Location: <Workspace>/Projects/Lyra/Config/Mac/MacGame.ini:3, section: [CommonInputPlatformSettings_Mac CommonInputPlatformSettings]

Location: <Workspace>/Projects/Lyra/Config/Windows/WindowsGame.ini:3, section: [CommonInputPlatformSettings_Windows CommonInputPlatformSettings]

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

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

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

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:358

Scope (from outer to inner):

file
function     bool UCommonInputPlatformSettings::SupportsInputType

Source code excerpt:

	case ECommonInputType::MouseAndKeyboard:
	{
		return bSupportsMouseAndKeyboard;
	}
	break;
	case ECommonInputType::Gamepad:
	{
		return bSupportsGamepad;
	}

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

Scope (from outer to inner):

file
function     void UCommonInputSettings::PostInitProperties

Source code excerpt:

			if (UCommonInputPlatformSettings* Settings = UPlatformSettingsManager::Get().GetSettingsForPlatform<UCommonInputPlatformSettings>(PlatformData.Key))
			{
				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:211

Scope (from outer to inner):

file
function     void UCommonInputSettings::PostInitProperties

Source code excerpt:

					if (PCPlatform)
					{
						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:261

Scope (from outer to inner):

file
class        class UCommonInputPlatformSettings : public UPlatformSettings

Source code excerpt:


	UPROPERTY(config, EditAnywhere, Category = "Default")
	bool bSupportsMouseAndKeyboard;

	UPROPERTY(config, EditAnywhere, Category = "Default")
	bool bSupportsTouch;

	UPROPERTY(config, EditAnywhere, Category = "Default")
	bool bSupportsGamepad;

#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Public/CommonInputBaseTypes.h:294

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:317

Scope (from outer to inner):

file
function     bool SupportsInputType

Source code excerpt:

		case ECommonInputType::MouseAndKeyboard:
		{
			return bSupportsMouseAndKeyboard;
		}
		break;
		case ECommonInputType::Gamepad:
		{
			return bSupportsGamepad;
		}

#Loc: <Workspace>/Engine/Plugins/Runtime/CommonUI/Source/CommonInput/Public/CommonInputBaseTypes.h:356

Scope: file

Source code excerpt:


	UPROPERTY(EditDefaultsOnly, Category = "Properties")
	bool bSupportsMouseAndKeyboard;

	UPROPERTY(EditDefaultsOnly, Category = "Gamepad")
	bool bSupportsGamepad;

	UPROPERTY(EditDefaultsOnly, Category = "Gamepad", Meta = (EditCondition = "bSupportsGamepad"))
	FName DefaultGamepadName;

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

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:154

Scope: file

Source code excerpt:

	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
	FString HardwareCompressionFormat;