UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FInputBehaviorModifierStates Class Reference

#include <InputBehaviorModifierStates.h>

Public Types

typedef TFunction< bool(const FInputDeviceState &)> FModifierTestFunction
 

Public Member Functions

void RegisterModifier (int ModifierID, const FModifierTestFunction &ModifierTest)
 
bool HasModifiers () const
 
void UpdateModifiers (const FInputDeviceState &Input, IModifierToggleBehaviorTarget *ModifiersTarget) const
 

Protected Attributes

TArray< int > ModifierIDs
 
TMap< int, FModifierTestFunctionModifierTests
 

Detailed Description

FInputBehaviorModifierStates is an object that can be placed in an InputBehavior to allow users of the behavior to request that they be notified about modifier keys/buttons/etc state.

We don't know ahead of time what might be used to determine modifier state, which input devices might be used, etc. So the user has to register (ModifierID,ModifierTestFunction) pairs. The behavior then calls UpdateModifiers() which will query each of the test functions and notify the target object about the state of the modifier.

Member Typedef Documentation

◆ FModifierTestFunction

Member Function Documentation

◆ HasModifiers()

bool FInputBehaviorModifierStates::HasModifiers ( ) const
inline
Returns
true if any modifiers have been registered

◆ RegisterModifier()

void FInputBehaviorModifierStates::RegisterModifier ( int  ModifierID,
const FModifierTestFunction ModifierTest 
)
inline

Register a modifier ID and an associated test function

Parameters
ModifierIDthe modifier ID
ModifierTestthe test function

◆ UpdateModifiers()

void FInputBehaviorModifierStates::UpdateModifiers ( const FInputDeviceState Input,
IModifierToggleBehaviorTarget ModifiersTarget 
) const
inline

Look up the current state of each registered modifier and pass to the target

Parameters
Inputthe current input device state
ModifiersTargetthe target that is interested in the modifier values

Member Data Documentation

◆ ModifierIDs

TArray<int> FInputBehaviorModifierStates::ModifierIDs
protected

List of modifier IDs that have been registered

◆ ModifierTests

TMap<int, FModifierTestFunction> FInputBehaviorModifierStates::ModifierTests
protected

The modifier test function for each ID


The documentation for this class was generated from the following file: