bFilterInputByPlatformUser
bFilterInputByPlatformUser
#Overview
name: bFilterInputByPlatformUser
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 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bFilterInputByPlatformUser is to control whether input from input devices should be filtered based on the platform user associated with the device. This setting is part of the input system in Unreal Engine 5.
This setting variable is primarily used in the Engine module, specifically within the input handling system. It is referenced in the InputSettings class and utilized in the PlayerController class.
The value of this variable is set in the UInputSettings constructor in InputSettings.cpp, where it is initialized to false by default. However, it can be modified through the project settings in the Unreal Engine editor, as it is marked with the UPROPERTY macro and the config specifier.
This variable interacts with the IPlatformInputDeviceMapper interface, which is used to determine the platform user associated with an input device.
Developers must be aware that when this setting is enabled, input will only be processed if it comes from an input device owned by the local player’s platform user. This can be useful in scenarios where multiple users might be using different input devices on the same machine, and you want to ensure that each player only responds to their own input.
Best practices when using this variable include:
- Consider enabling this setting in multiplayer games or applications where multiple users might be using different input devices on the same machine.
- Ensure that the platform-specific implementation of IPlatformInputDeviceMapper correctly associates input devices with platform users.
- Be aware that enabling this setting might filter out input from devices not associated with a specific user, which could affect debugging or testing scenarios.
- If you enable this setting, make sure to test your game thoroughly with multiple input devices to ensure the desired behavior.
- Document the use of this setting in your project, as it can significantly affect how input is handled across the game.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultInput.ini:34, section: [/Script/Engine.InputSettings]
- INI Section:
/Script/Engine.InputSettings
- Raw value:
True
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/GameFramework/InputSettings.h:76
Scope (from outer to inner):
file
class class UInputSettings : public UObject
Source code excerpt:
*/
UPROPERTY(config, EditAnywhere, Category = "Input")
uint8 bFilterInputByPlatformUser:1;
/**
* If true, then the input device subsystem will be allowed to Initalize when the engine boots.
* NOTE: For this setting to take effect, and editor restart is required.
*
* @see UInputDeviceSubsystem
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PlayerController.cpp:2411
Scope (from outer to inner):
file
function bool APlayerController::InputKey
Source code excerpt:
// Only process the given input if it came from an input device that is owned by our owning local player
if (GetDefault<UInputSettings>()->bFilterInputByPlatformUser &&
IPlatformInputDeviceMapper::Get().GetUserForInputDevice(Params.InputDevice) != GetPlatformUserId())
{
return false;
}
// Any analog values can simply be passed to the UPlayerInput
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UserInterface/InputSettings.cpp:26
Scope (from outer to inner):
file
function UInputSettings::UInputSettings
Source code excerpt:
, bEnableLegacyInputScales(true)
, bEnableMotionControls(true)
, bFilterInputByPlatformUser(false)
, bEnableInputDeviceSubsystem(true)
, bShouldFlushPressedKeysOnViewportFocusLost(true)
, bEnableDynamicComponentInputBinding(true)
, DefaultViewportMouseCaptureMode(EMouseCaptureMode::CapturePermanently_IncludingInitialMouseDown)
, DefaultViewportMouseLockMode(EMouseLockMode::LockOnCapture)
, DefaultPlayerInputClass(UPlayerInput::StaticClass())