Navigation
API > API/Runtime > API/Runtime/Engine
Object within PlayerController that processes player input. Only exists on the client in network games.
| Name | UPlayerInput |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/GameFramework/PlayerInput.h |
| Include Path | #include "GameFramework/PlayerInput.h" |
Syntax
UCLASS (Config=Input, Transient, MinimalAPI)
class UPlayerInput : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UPlayerInput
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UPlayerInput() |
GameFramework/PlayerInput.h |
Structs
| Name | Remarks |
|---|---|
| FActionKeyDetails | Runtime struct that caches the list of mappings for a given Action Name and the capturing chord if applicable |
| FAxisKeyDetails | Runtime struct that caches the list of mappings for a given Axis Name and whether that axis is currently inverted |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| EngineDefinedActionMappings | TArray< FInputActionKeyMapping > | Action Mappings defined by engine systems that cannot be remapped by users | GameFramework/PlayerInput.h |
| EngineDefinedAxisMappings | TArray< FInputAxisKeyMapping > | Axis Mappings defined by engine systems that cannot be remapped by users | GameFramework/PlayerInput.h |
| NoAxisMappings | const TArray< FInputAxisKeyMapping > | Static empty array to be able to return from GetKeysFromAxis when there are no axis mapped to the requested axis name | GameFramework/PlayerInput.h |
| NoKeyMappings | const TArray< FInputActionKeyMapping > | Static empty array to be able to return from GetKeysFromAction when there are no keys mapped to the requested action name | GameFramework/PlayerInput.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActionMappings | TArray< struct FInputActionKeyMapping > | This player's version of the Action Mappings | GameFramework/PlayerInput.h | |
| AxisConfig | TArray< struct FInputAxisConfigEntry > | This player's version of the Axis Properties | GameFramework/PlayerInput.h | |
| AxisMappings | TArray< struct FInputAxisKeyMapping > | This player's version of Axis Mappings | GameFramework/PlayerInput.h | |
| DebugExecBindings | TArray< struct FKeyBind > | Generic bindings of keys to Exec()-compatible strings for development purposes only | GameFramework/PlayerInput.h |
|
| InvertedAxis | TArray< FName > | List of Axis Mappings that have been inverted | GameFramework/PlayerInput.h |
|
| MouseSamples | int32 | Current average mouse movement/sample | GameFramework/PlayerInput.h | |
| MouseSamplingTotal | float | Number of mouse samples since mouse movement has been zero | GameFramework/PlayerInput.h | |
| SmoothedMouse | float | How long received mouse movement has been zero. | GameFramework/PlayerInput.h | |
| Touches | FVector | NOTE: These touch vectors are calculated and set directly, they do not go through the .ini Bindings Touch locations, from 0..1 (0,0 is top left, 1,1 is bottom right), the Z component is > 0 if the touch is currently held down | GameFramework/PlayerInput.h | |
| TouchEventLocations | TMap< uint32, FVector > | Used to store paired touch locations for event ids during the frame and flushed when processed. | GameFramework/PlayerInput.h | |
| ZeroTime | float | Mouse smoothing sample data. | GameFramework/PlayerInput.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActionKeyMap | TMap< FName, FActionKeyDetails > | Map of Action Name to details about the keys mapped to that action | GameFramework/PlayerInput.h | |
| AxisKeyMap | TMap< FName, FAxisKeyDetails > | Map of Axis Name to details about the keys mapped to that axis | GameFramework/PlayerInput.h | |
| AxisProperties | TMap< FKey, FInputAxisProperties > | Internal structure for storing axis config data. | GameFramework/PlayerInput.h | |
| bKeyMapsBuilt | uint8 | GameFramework/PlayerInput.h | ||
| CurrentEvent | TEnumAsByte< EInputEvent > | DirectInput's mouse sampling total time | GameFramework/PlayerInput.h | |
| EventCount | uint32 | A counter used to track the order in which events occurred since the last time the input stack was processed | GameFramework/PlayerInput.h | |
| EventIndices | TArray< uint32 > | Temporary array used as part of input processing. | GameFramework/PlayerInput.h | |
| FGestureRecognizer | friend | GameFramework/PlayerInput.h | ||
| GestureRecognizer | FGestureRecognizer | Gesture recognizer object | GameFramework/PlayerInput.h | |
| KeyMapBuildIndex | uint32 | GameFramework/PlayerInput.h | ||
| KeyStateMap | TMap< FKey, FKeyState > | The current game view of each key | GameFramework/PlayerInput.h | |
| LastTimeDilation | float | Cache the last time dilation so as to be able to clear smoothing when it changes | GameFramework/PlayerInput.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddActionMapping
(
const FInputActionKeyMapping& KeyMapping |
Add a player specific action mapping. | GameFramework/PlayerInput.h | |
void AddAxisMapping
(
const FInputAxisKeyMapping& KeyMapping |
Add a player specific axis mapping. | GameFramework/PlayerInput.h | |
void ClearSmoothing() |
Exec function to reset mouse smoothing values | GameFramework/PlayerInput.h |
|
void DiscardPlayerInput () |
Rather than processing input, consume it and discard without doing anything useful with it. | GameFramework/PlayerInput.h | |
virtual void DisplayDebug
(
UCanvas* Canvas, |
Draw important PlayerInput variables on canvas. | GameFramework/PlayerInput.h | |
bool Exec
(
UWorld* UInWorld, |
Exec handler | GameFramework/PlayerInput.h | |
bool ExecInputCommands
(
UWorld* InWorld, |
Execute input commands within the legacy key binding system. | GameFramework/PlayerInput.h | |
void FlushPressedActionBindingKeys
(
FName ActionName |
Flushes the current key state of the keys associated with the action name passed in | GameFramework/PlayerInput.h | |
virtual void FlushPressedKeys() |
Flushes the current key state. | GameFramework/PlayerInput.h | |
void ForceRebuildingKeyMaps
(
const bool bRestoreDefaults |
Clear the current cached key maps and rebuild from the source arrays. | GameFramework/PlayerInput.h | |
bool GetAxisProperties
(
const FKey AxisKey, |
Gets the axis properties for a given AxisKey. | GameFramework/PlayerInput.h | |
FString GetBind
(
FKey Key |
Returns the command for a given key in the legacy binding system | GameFramework/PlayerInput.h | |
FKeyBind GetExecBind
(
FString const& ExecCommand |
Get the legacy Exec key binding for the given command. | GameFramework/PlayerInput.h | |
bool GetInvertAxis
(
const FName AxisName |
Returns whether an Axis Mapping is inverted | GameFramework/PlayerInput.h | |
bool GetInvertAxisKey
(
const FKey AxisKey |
Returns whether an Axis Key is inverted | GameFramework/PlayerInput.h | |
uint32 GetKeyMapBuildIndex() |
GameFramework/PlayerInput.h | ||
const TArray< FInputActionKeyMapping > & GetKeysForAction
(
const FName ActionName |
Returns the list of keys mapped to the specified Action Name | GameFramework/PlayerInput.h | |
const TArray< FInputAxisKeyMapping > & GetKeysForAxis
(
const FName AxisName |
Returns the list of keys mapped to the specified Axis Name | GameFramework/PlayerInput.h | |
const FKeyState * GetKeyState
(
FKey InKey |
GameFramework/PlayerInput.h | ||
FKeyState * GetKeyState
(
FKey InKey |
GameFramework/PlayerInput.h | ||
float GetKeyValue
(
FKey InKey |
GameFramework/PlayerInput.h | ||
float GetMouseSensitivityX() |
Returns the mouse sensitivity along the X-axis, or the Y-axis, or 1.0 if none are known. | GameFramework/PlayerInput.h | |
float GetMouseSensitivityY() |
Returns the mouse sensitivity along the Y-axis, or 1.0 if none are known. | GameFramework/PlayerInput.h | |
| Return's this object casted to a player controller. | GameFramework/PlayerInput.h |
|
|
| Returns the owning local player of this Input Object. | GameFramework/PlayerInput.h | ||
FVector GetProcessedVectorKeyValue
(
FKey InKey |
GameFramework/PlayerInput.h | ||
float GetRawKeyValue
(
FKey InKey |
GameFramework/PlayerInput.h | ||
FVector GetRawVectorKeyValue
(
FKey InKey |
GameFramework/PlayerInput.h | ||
float GetTimeDown
(
FKey InKey |
GameFramework/PlayerInput.h | ||
virtual UWorld * GetWorld() |
GameFramework/PlayerInput.h | ||
bool InputGesture
(
const FInputDeviceId DeviceId, |
Handles a gesture input event. Returns true. | GameFramework/PlayerInput.h | |
bool InputGesture
(
const FKey Gesture, |
Handles a gesture input event. Returns true. | GameFramework/PlayerInput.h | |
virtual bool InputKey
(
const FInputKeyEventArgs& Params |
Handles a key input event. Returns true if there is an action that handles the specified key. | GameFramework/PlayerInput.h | |
virtual PRAGMA_DISABLE_DEPRECATION_WARNINGS bool InputKey
(
const FInputKeyParams& Params |
Handles a key input event. Returns true if there is an action that handles the specified key. | GameFramework/PlayerInput.h | |
bool InputMotion
(
const FVector& Tilt, |
Handles a motion input event. Returns true. | GameFramework/PlayerInput.h | |
bool InputMotion
(
const FInputDeviceId DeviceId, |
Handles a motion input event. Returns true. | GameFramework/PlayerInput.h | |
bool InputTouch
(
uint32 Handle, |
Handles a touch input event. Returns true. | GameFramework/PlayerInput.h | |
bool InputTouch
(
const FInputDeviceId DeviceId, |
Handles a touch input event. Returns true. | GameFramework/PlayerInput.h | |
void InvertAxis
(
const FName AxisName |
Exec function to invert an axis mapping | GameFramework/PlayerInput.h |
|
void InvertAxisKey
(
const FKey AxisKey |
Exec function to invert an axis key | GameFramework/PlayerInput.h |
|
bool IsAltPressed() |
GameFramework/PlayerInput.h | ||
bool IsCmdPressed() |
GameFramework/PlayerInput.h | ||
bool IsCtrlPressed() |
GameFramework/PlayerInput.h | ||
bool IsPressed
(
FKey InKey |
GameFramework/PlayerInput.h | ||
bool IsShiftPressed() |
GameFramework/PlayerInput.h | ||
virtual void ProcessInputStack
(
const TArray< UInputComponent* >& InputComponentStack, |
Process the frame's input events given the current input component stack. | GameFramework/PlayerInput.h | |
void RemoveActionMapping
(
const FInputActionKeyMapping& KeyMapping |
Remove a player specific action mapping. | GameFramework/PlayerInput.h | |
void RemoveAxisMapping
(
const FInputAxisKeyMapping& KeyMapping |
Remove a player specific axis mapping. | GameFramework/PlayerInput.h | |
void SetAxisProperties
(
const FKey AxisKey, |
Gets the axis properties for a given AxisKey. | GameFramework/PlayerInput.h | |
void SetBind
(
FName BindName, |
Exec function to add a debug exec command | GameFramework/PlayerInput.h |
|
void SetMouseSensitivity
(
const float Sensitivity |
Sets both X and Y axis sensitivity to the supplied value. | GameFramework/PlayerInput.h |
|
void SetMouseSensitivity
(
const float SensitivityX, |
Exec function to change the mouse sensitivity | GameFramework/PlayerInput.h | |
virtual float SmoothMouse
(
float aMouse, |
Smooth mouse movement, because mouse sampling doesn't match up with tick time. | GameFramework/PlayerInput.h | |
void Tick
(
float DeltaTime |
Per frame tick function. Primarily for gesture recognition | GameFramework/PlayerInput.h | |
void UpdatePinchStartDistance() |
Manually update the GestureRecognizer AnchorDistance using the current locations of the touches | GameFramework/PlayerInput.h | |
bool WasJustPressed
(
FKey InKey |
GameFramework/PlayerInput.h | ||
bool WasJustReleased
(
FKey InKey |
Return true if InKey went from down to up since player input was last processed. | GameFramework/PlayerInput.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostInitProperties() |
GameFramework/PlayerInput.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ConditionalInitAxisProperties() |
Initialized axis properties (i.e deadzone values) if needed | GameFramework/PlayerInput.h | |
virtual void EvaluateInputDelegates
(
const TArray< UInputComponent* >& InputComponentStack, |
Evaluates the state of any bound input delegates on the given Input Component Stack. | GameFramework/PlayerInput.h | |
virtual void EvaluateKeyMapState
(
const float DeltaTime, |
Evaluates the current state of the KeyStateMap this tick. | GameFramework/PlayerInput.h | |
void GetActionsBoundToKey
(
UInputComponent* InputComponent, |
Retrieves the actions bound to the given input component which are triggered by a given key. | GameFramework/PlayerInput.h | |
| GameFramework/PlayerInput.h | |||
virtual bool IsKeyHandledByAction
(
FKey Key |
GameFramework/PlayerInput.h | ||
virtual float MassageAxisInput
(
FKey Key, |
Given raw keystate value, returns the "massaged" value. | GameFramework/PlayerInput.h | |
virtual FVector MassageVectorAxisInput
(
FKey Key, |
Given raw keystate value of a vector axis, returns the "massaged" value. | GameFramework/PlayerInput.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void AddEngineDefinedActionMapping
(
const FInputActionKeyMapping& ActionMapping |
Add an engine defined action mapping that cannot be remapped. | GameFramework/PlayerInput.h | |
static void AddEngineDefinedAxisMapping
(
const FInputAxisKeyMapping& AxisMapping |
Add an engine defined axis mapping that cannot be remapped. | GameFramework/PlayerInput.h | |
static const TArray< FInputActionKeyMapping > & GetEngineDefinedActionMappings() |
GameFramework/PlayerInput.h | ||
static const TArray< FInputAxisKeyMapping > & GetEngineDefinedAxisMappings() |
GameFramework/PlayerInput.h |