bEnableUserSettings

bEnableUserSettings

#Overview

name: bEnableUserSettings

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

It is referenced in 9 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bEnableUserSettings is to control whether user-specific input settings are enabled in the Enhanced Input system of Unreal Engine 5. This setting is primarily used for managing custom input configurations on a per-player basis.

The Enhanced Input system, which is part of the EnhancedInput plugin, relies on this setting variable. It is also referenced in the VirtualCameraCore plugin, indicating its relevance to virtual camera functionality.

The value of this variable is typically set in the UEnhancedInputDeveloperSettings class, which is a configuration class for the Enhanced Input system. It is defined as a config property, meaning it can be modified through project settings or configuration files.

This variable interacts with other components of the Enhanced Input system, such as UEnhancedInputUserSettings and UEnhancedPlayerInput. When enabled, it triggers the initialization of user settings and allows for player-specific input mappings.

Developers must be aware that:

  1. This feature is marked as experimental, as indicated by the “Experimental” tag in the property metadata.
  2. Enabling this setting may have performance implications, as it introduces additional checks and operations related to user-specific input configurations.
  3. Some functionality, like binding user setting delegates, relies on this setting being enabled.

Best practices when using this variable include:

  1. Only enable it if you need user-specific input configurations in your project.
  2. Be prepared to handle potential changes or deprecations, as it’s marked experimental.
  3. Ensure that all related systems (like virtual camera functionality) are compatible with user settings when enabling this feature.
  4. Monitor performance impacts and consider the trade-offs between customization and optimization.
  5. Use it in conjunction with other Enhanced Input settings for a comprehensive input management strategy.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/DefaultInput.ini:48, section: [/Script/EnhancedInput.EnhancedInputDeveloperSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Private/EnhancedInputDeveloperSettings.cpp:27

Scope (from outer to inner):

file
function     UEnhancedInputDeveloperSettings::UEnhancedInputDeveloperSettings

Source code excerpt:

	, DefaultWorldInputClass(UEnhancedPlayerInput::StaticClass())
	, bSendTriggeredEventsWhenInputIsFlushed(true)
	, bEnableUserSettings(false)
	, bEnableDefaultMappingContexts(true)
	, bShouldOnlyTriggerLastActionInChord(true)
	, bLogOnDeprecatedConfigUsed(true)
	, bEnableWorldSubsystem(false)
	, bShouldLogAllWorldSubsystemInputs(false)
{

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Private/EnhancedInputSubsystemInterface.cpp:65

Scope (from outer to inner):

file
function     void IEnhancedInputSubsystemInterface::BindUserSettingDelegates

Source code excerpt:

	// There is no need to bind to any delegates if the setting is turned off. We shouldn't even get here,
	// but do this in case someone implements this interface
	if (!GetDefault<UEnhancedInputDeveloperSettings>()->bEnableUserSettings)
	{
		UE_LOG(LogEnhancedInput, Error, TEXT("Attempting to bind to user settings delegates but they are disabled in UEnhancedInputDeveloperSettings!"));
		return;
	}

	Settings->OnSettingsChanged.AddUniqueDynamic(this, &IEnhancedInputSubsystemInterface::OnUserSettingsChanged);

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Private/EnhancedInputSubsystemInterface.cpp:949

Scope (from outer to inner):

file
function     void IEnhancedInputSubsystemInterface::RebuildControlMappings

Source code excerpt:

			
			// See if there are any player mapped keys to this action
			if (PlayerKeyProfile && GetDefault<UEnhancedInputDeveloperSettings>()->bEnableUserSettings)
			{
				PlayerKeyProfile->GetPlayerMappedKeysForRebuildControlMappings(Mapping, MappedKeysToActionName);
			}

			// True if there were any player mapped keys to this mapping and we are using those instead.
			const bool bIsPlayerMapping = !MappedKeysToActionName.IsEmpty();

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Private/EnhancedInputSubsystems.cpp:27

Scope (from outer to inner):

file
function     void UEnhancedInputLocalPlayerSubsystem::Initialize

Source code excerpt:

	Super::Initialize(Collection);
	
	if (GetDefault<UEnhancedInputDeveloperSettings>()->bEnableUserSettings)
	{
		InitalizeUserSettings();
	}
}

void UEnhancedInputLocalPlayerSubsystem::PlayerControllerChanged(APlayerController* NewPlayerController)

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Private/EnhancedInputSubsystems.cpp:37

Scope (from outer to inner):

file
function     void UEnhancedInputLocalPlayerSubsystem::PlayerControllerChanged

Source code excerpt:

	Super::PlayerControllerChanged(NewPlayerController);
	
	if (GetDefault<UEnhancedInputDeveloperSettings>()->bEnableUserSettings)
	{
		InitalizeUserSettings();
	}
}

UEnhancedPlayerInput* UEnhancedInputLocalPlayerSubsystem::GetPlayerInput() const

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Private/EnhancedInputSubsystems.cpp:79

Scope (from outer to inner):

file
function     void UEnhancedInputLocalPlayerSubsystem::InitalizeUserSettings

Source code excerpt:

	}

	if (!GetDefault<UEnhancedInputDeveloperSettings>()->bEnableUserSettings)
	{
		UE_LOG(LogEnhancedInput, Verbose, TEXT("bEnableUserSettings is set to false, skipping creation of UEnhancedInputUserSettings!"));
		return;
	}
	
	UserSettings = UEnhancedInputUserSettings::LoadOrCreateSettings(LP);

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Public/EnhancedInputDeveloperSettings.h:103

Scope (from outer to inner):

file
class        class UEnhancedInputDeveloperSettings : public UDeveloperSettingsBackedByCVars

Source code excerpt:

	 */
	UPROPERTY(config, EditAnywhere, Category = "Enhanced Input|User Settings", meta=(DisplayName="Enable User Settings (Experimental)", DisplayPriority = 1))
	uint8 bEnableUserSettings : 1;

	/** If true, then the DefaultMappingContexts will be applied to all Enhanced Input Subsystems. */
	UPROPERTY(config, EditAnywhere, Category = "Enhanced Input", meta = (ConsoleVariable = "EnhancedInput.EnableDefaultMappingContexts"))
	uint8 bEnableDefaultMappingContexts : 1;

	/**

#Loc: <Workspace>/Engine/Plugins/VirtualProduction/VirtualCameraCore/Source/VCamCore/Private/Input/InputVCamSubsystem.cpp:71

Scope (from outer to inner):

file
function     void UInputVCamSubsystem::Initialize

Source code excerpt:

#endif
		
		if (GetDefault<UEnhancedInputDeveloperSettings>()->bEnableUserSettings)
		{
			InitalizeUserSettings();
		}
	}
}

#Loc: <Workspace>/Engine/Plugins/VirtualProduction/VirtualCameraCore/Source/VCamCore/Private/VCamCore.cpp:25

Scope (from outer to inner):

file
namespace    UE::VCamCore::Private
function     void FVCamCoreModule::StartupModule
lambda-function

Source code excerpt:

		{
			UEnhancedInputDeveloperSettings* Settings = GetMutableDefault<UEnhancedInputDeveloperSettings>();
			UE_CLOG(!Settings->bEnableUserSettings, LogVCamCore, Log, TEXT("Overriding Settings->bEnableUserSettings = true because it is required for VCam to work properly."));
			Settings->bEnableUserSettings = true;
		});
	}

	void FVCamCoreModule::ShutdownModule()
	{
		UnregisterSettings();