Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/GameFramework
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UPlayerInput
- UEnhancedPlayerInput
- UDisplayClusterPlayerInput
- UVCamPlayerInput
References
| Module | Engine |
| Header | /Engine/Source/Runtime/Engine/Classes/GameFramework/PlayerInput.h |
| Include | #include "GameFramework/PlayerInput.h" |
Syntax
class UPlayerInput : public UObject
Remarks
Object within PlayerController that processes player input. Only exists on the client in network games.
Variables
| Type | Name | Description | |
|---|---|---|---|
| TArray< struct FInputActionKeyMapping > | ActionMappings | This player's version of the Action Mappings | |
| TArray< struct FInputAxisConfigEntry > | AxisConfig | This player's version of the Axis Properties | |
| TArray< struct FInputAxisKeyMapping > | AxisMappings | This player's version of Axis Mappings | |
| TArray< struct FKeyBind > | DebugExecBindings | Generic bindings of keys to Exec()-compatible strings for development purposes only | |
| TArray< FName > | InvertedAxis | List of Axis Mappings that have been inverted | |
| int32 | MouseSamples | Current average mouse movement/sample | |
| float | MouseSamplingTotal | Number of mouse samples since mouse movement has been zero | |
| float[2] | SmoothedMouse | How long received mouse movement has been zero. | |
| FVector[EKeys::NUM_TOUCH_KEYS] | Touches | 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 | |
| TMap< uint32, FVector > | TouchEventLocations | Used to store paired touch locations for event ids during the frame and flushed when processed. | |
| float[2] | ZeroTime | Mouse smoothing sample data. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UPlayerInput () |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddActionMapping
(
const FInputActionKeyMapping& KeyMapping |
Add a player specific action mapping. | |
| void | AddAxisMapping
(
const FInputAxisKeyMapping& KeyMapping |
Add a player specific axis mapping. | |
| void | AddEngineDefinedActionMapping
(
const FInputActionKeyMapping& ActionMapping |
Add an engine defined action mapping that cannot be remapped. | |
| void | AddEngineDefinedAxisMapping
(
const FInputAxisKeyMapping& AxisMapping |
Add an engine defined axis mapping that cannot be remapped. | |
| void | Exec function to reset mouse smoothing values | ||
| void | Initialized axis properties (i.e deadzone values) if needed | ||
| void | Rather than processing input, consume it and discard without doing anything useful with it. | ||
| void | DisplayDebug
(
UCanvas* Canvas, |
Draw important PlayerInput variables on canvas. | |
| bool | Exec
(
UWorld* UInWorld, |
Exec handler | |
| bool | ExecInputCommands
(
UWorld* InWorld, |
Execute input commands within the legacy key binding system. | |
| void | FlushPressedActionBindingKeys
(
FName ActionName |
Flushes the current key state of the keys associated with the action name passed in | |
| void | Flushes the current key state. | ||
| void | ForceRebuildingKeyMaps
(
const bool bRestoreDefaults |
Clear the current cached key maps and rebuild from the source arrays. | |
| bool | GetAxisProperties
(
const FKey AxisKey, |
Gets the axis properties for a given AxisKey. | |
| FString | Returns the command for a given key in the legacy binding system | ||
| const TArray< FInputActionKeyMapping > & | |||
| const TArray< FInputAxisKeyMapping > & | |||
| FKeyBind | GetExecBind
(
FString const& ExecCommand |
Get the legacy Exec key binding for the given command. | |
| bool | GetInvertAxis
(
const FName AxisName |
Returns whether an Axis Mapping is inverted | |
| bool | GetInvertAxisKey
(
const FKey AxisKey |
Returns whether an Axis Key is inverted | |
| uint32 | |||
| const TArray< FInputActionKeyMapping > & | GetKeysForAction
(
const FName ActionName |
Returns the list of keys mapped to the specified Action Name | |
| const TArray< FInputAxisKeyMapping > & | GetKeysForAxis
(
const FName AxisName |
Returns the list of keys mapped to the specified Axis Name | |
| const FKeyState * | GetKeyState
(
FKey InKey |
||
| FKeyState * | GetKeyState
(
FKey InKey |
||
| TMap< FKey, FKeyState > & | |||
| float | GetKeyValue
(
FKey InKey |
||
| float | Returns the mouse sensitivity along the X-axis, or the Y-axis, or 1.0 if none are known. | ||
| float | Returns the mouse sensitivity along the Y-axis, or 1.0 if none are known. | ||
| APlayerController * | Return's this object casted to a player controller. | ||
| ULocalPlayer * | Returns the owning local player of this Input Object. | ||
| FVector | GetProcessedVectorKeyValue
(
FKey InKey |
||
| float | GetRawKeyValue
(
FKey InKey |
||
| FVector | GetRawVectorKeyValue
(
FKey InKey |
||
| float | GetTimeDown
(
FKey InKey |
||
| UWorld * | GetWorld () |
||
| bool | InputGesture
(
const FKey Gesture, |
Handles a gesture input event. Returns true. | |
| bool | InputKey
(
const FInputKeyParams& Params |
Handles a key input event. Returns true if there is an action that handles the specified key. | |
| bool | InputMotion
(
const FVector& Tilt, |
Handles a motion input event. Returns true. | |
| bool | InputTouch
(
uint32 Handle, |
Handles a touch input event. Returns true. | |
| void | InvertAxis
(
const FName AxisName |
Exec function to invert an axis mapping | |
| void | InvertAxisKey
(
const FKey AxisKey |
Exec function to invert an axis key | |
| bool | IsAltPressed () |
||
| bool | IsCmdPressed () |
||
| bool | |||
| bool | IsKeyHandledByAction
(
FKey Key |
||
| bool | |||
| bool | |||
| float | MassageAxisInput
(
FKey Key, |
Given raw keystate value, returns the "massaged" value. | |
| FVector | MassageVectorAxisInput
(
FKey Key, |
Given raw keystate value of a vector axis, returns the "massaged" value. | |
| void | ProcessInputStack
(
const TArray< UInputComponent* >& InputComponentStack, |
Process the frame's input events given the current input component stack. | |
| void | RemoveActionMapping
(
const FInputActionKeyMapping& KeyMapping |
Remove a player specific action mapping. | |
| void | RemoveAxisMapping
(
const FInputAxisKeyMapping& KeyMapping |
Remove a player specific axis mapping. | |
| void | SetAxisProperties
(
const FKey AxisKey, |
Gets the axis properties for a given AxisKey. | |
| void | Exec function to add a debug exec command | ||
| void | SetMouseSensitivity
(
const float Sensitivity |
Sets both X and Y axis sensitivity to the supplied value. | |
| void | SetMouseSensitivity
(
const float SensitivityX, |
Exec function to change the mouse sensitivity | |
| float | SmoothMouse
(
float aMouse, |
Smooth mouse movement, because mouse sampling doesn't match up with tick time. | |
| void | Tick
(
float DeltaTime |
Per frame tick function. Primarily for gesture recognition | |
| void | Manually update the GestureRecognizer AnchorDistance using the current locations of the touches | ||
| bool | WasJustPressed
(
FKey InKey |
||
| bool | WasJustReleased
(
FKey InKey |
Return true if InKey went from down to up since player input was last processed. |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| void | Called after the C++ constructor and after the properties have been initialized, including those loaded from config. |
Constants
| Name | Description |
|---|---|
| EngineDefinedActionMappings | Action Mappings defined by engine systems that cannot be remapped by users |
| EngineDefinedAxisMappings | Axis Mappings defined by engine systems that cannot be remapped by users |
| NoAxisMappings | Static empty array to be able to return from GetKeysFromAxis when there are no axis mapped to the requested axis name |
| NoKeyMappings | Static empty array to be able to return from GetKeysFromAction when there are no keys mapped to the requested action name |
Deprecated Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | InputAxis has been deprecated, please use the version of InputKey which takes in FInputKeyParams | ||
| bool | This version of InputKey has been deprecated, please use that which takes in FInputKeyParams |
See Also
https://docs.unrealengine.com/latest/INT/Gameplay/Input/index.html