Slate.EnableGamepadEditorNavigation

Slate.EnableGamepadEditorNavigation

#Overview

name: Slate.EnableGamepadEditorNavigation

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of Slate.EnableGamepadEditorNavigation is to control whether gamepad navigation is allowed outside of the game viewport in the Unreal Engine editor environment.

This setting variable is primarily used by the Slate subsystem, which is responsible for the UI framework in Unreal Engine. It also interacts with the Virtual Camera Core plugin, specifically in the VCamCore module.

The value of this variable is initially set to true in the Slate application code. It can be modified at runtime through the console variable system, allowing developers to enable or disable gamepad navigation in the editor dynamically.

The GSlateEnableGamepadEditorNavigation global variable interacts directly with this setting. In the Virtual Camera Core plugin, there’s also an interaction with a GEnableGamepadEditorNavigationValueBeforeSetting variable, which stores the previous state of the setting.

Developers must be aware that this variable affects the behavior of gamepad input throughout the editor interface. Enabling it allows gamepad navigation outside the game viewport, which can be useful for certain workflows but may interfere with game-specific gamepad input testing.

Best practices when using this variable include:

  1. Consider the needs of your development team - enable it if you frequently use gamepads for editor navigation.
  2. Be cautious when modifying this setting in shipping builds, as it’s primarily intended for editor use.
  3. When using the Virtual Camera Core plugin, be aware that it may temporarily modify this setting and restore it later.
  4. If you’re developing editor tools or plugins, respect this setting when implementing gamepad input to ensure consistent behavior across the editor.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Slate/Private/Framework/Application/SlateApplication.cpp:106

Scope: file

Source code excerpt:

bool GSlateEnableGamepadEditorNavigation = true;
static FAutoConsoleVariableRef CVarSlateEnableGamepadEditorNavigation(
	TEXT("Slate.EnableGamepadEditorNavigation"),
	GSlateEnableGamepadEditorNavigation,
	TEXT("True implies we allow gamepad navigation outside of the game viewport.")
);

static bool GSlateUseFixedDeltaTime = false;
static FAutoConsoleVariableRef CVarSlateUseFixedDeltaTime(

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

Scope (from outer to inner):

file
namespace    UE::VCamCore::Private
function     static void IncrementAndSetEnableGamepadEditorNavigation

Source code excerpt:

		++GVCamInputSubsystemCount;
	
		if (IConsoleVariable* ConsoleVariable = IConsoleManager::Get().FindConsoleVariable(TEXT("Slate.EnableGamepadEditorNavigation")))
		{
			if (GVCamInputSubsystemCount == 1)
			{
				GEnableGamepadEditorNavigationValueBeforeSetting = ConsoleVariable->GetBool();
			}
		

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

Scope (from outer to inner):

file
namespace    UE::VCamCore::Private
function     static void DecrementAndResetEnableGamepadEditorNavigation

Source code excerpt:

	{
		--GVCamInputSubsystemCount;
		if (IConsoleVariable* ConsoleVariable = IConsoleManager::Get().FindConsoleVariable(TEXT("Slate.EnableGamepadEditorNavigation"))
			; GVCamInputSubsystemCount == 0 && ConsoleVariable)
		{
			ConsoleVariable->Set(GEnableGamepadEditorNavigationValueBeforeSetting);
		}
	}
#endif