Navigation
API > API/Runtime > API/Runtime/Engine
Implement an Actor component for input bindings.
An Input Component is a transient component that enables an Actor to bind various forms of input events to delegate functions. Input components are processed from a stack managed by the PlayerController and processed by the PlayerInput. Each binding can consume the input event preventing other components on the input stack from processing the input.
| Name | UInputComponent |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Components/InputComponent.h |
| Include Path | #include "Components/InputComponent.h" |
Syntax
UCLASS (NotBlueprintable, Transient, Config=Input,
HideCategories=(Activation, "Components|Activation"), MinimalAPI)
class UInputComponent : public UActorComponent
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UActorComponent → UInputComponent
Implements Interfaces
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UInputComponent
(
const FObjectInitializer& ObjectInitializer |
Components/InputComponent.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AxisBindings | TArray< FInputAxisBinding > | The collection of axis bindings. | Components/InputComponent.h | |
| AxisKeyBindings | TArray< FInputAxisKeyBinding > | The collection of axis key bindings. | Components/InputComponent.h | |
| bBlockInput | uint8 | Whether any components lower on the input stack should be allowed to receive input. | Components/InputComponent.h | |
| GestureBindings | TArray< FInputGestureBinding > | The collection of gesture bindings. | Components/InputComponent.h | |
| KeyBindings | TArray< FInputKeyBinding > | The collection of key bindings. | Components/InputComponent.h | |
| Priority | int32 | The priority of this input component when pushed in to the stack. | Components/InputComponent.h | |
| TouchBindings | TArray< FInputTouchBinding > | The collection of touch bindings. | Components/InputComponent.h | |
| VectorAxisBindings | TArray< FInputVectorAxisBinding > | The collection of vector axis bindings. | Components/InputComponent.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActionBindings | TArray< TSharedPtr< FInputActionBinding > > | Holds the collection of action bindings. | Components/InputComponent.h | |
| CachedKeyToActionInfo | TArray< FCachedKeyToActionInfo > | Components/InputComponent.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FInputActionBinding & AddActionBinding
(
FInputActionBinding Binding |
Adds the specified action binding. | Components/InputComponent.h | |
FInputActionBinding & BindAction
(
const FName ActionName, |
Binds a delegate function to an Action defined in the project settings. | Components/InputComponent.h | |
FInputActionBinding & BindAction
(
const FName ActionName, |
Binds a delegate function to an Action defined in the project settings. | Components/InputComponent.h | |
FInputActionBinding & BindAction
(
const FName ActionName, |
Binds a delegate function to an Action defined in the project settings. | Components/InputComponent.h | |
FInputAxisBinding & BindAxis
(
const FName AxisName, |
Binds a delegate function an Axis defined in the project settings. | Components/InputComponent.h | |
FInputAxisBinding & BindAxis
(
const FName AxisName |
Indicates that the InputComponent is interested in knowing the Axis value (via GetAxisValue) but does not want a delegate function called each frame. | Components/InputComponent.h | |
FInputAxisKeyBinding & BindAxisKey
(
const FKey AxisKey, |
Binds a delegate function for an axis key (e.g. Mouse X). | Components/InputComponent.h | |
FInputAxisKeyBinding & BindAxisKey
(
const FKey AxisKey |
Indicates that the InputComponent is interested in knowing/consuming an axis key's value (via GetAxisKeyValue) but does not want a delegate function called each frame. | Components/InputComponent.h | |
FInputGestureBinding & BindGesture
(
const FKey GestureKey, |
Binds a gesture event to a delegate function. | Components/InputComponent.h | |
FInputKeyBinding & BindKey
(
const FKey Key, |
Binds a key event to a delegate function. | Components/InputComponent.h | |
FInputKeyBinding & BindKey
(
const FKey Key, |
Binds a key event to a delegate function with key signature. | Components/InputComponent.h | |
FInputKeyBinding & BindKey
(
const FInputChord Chord, |
Binds a chord event to a delegate function. | Components/InputComponent.h | |
FInputTouchBinding & BindTouch
(
const EInputEvent KeyEvent, |
Binds this input component to touch events. | Components/InputComponent.h | |
FInputVectorAxisBinding & BindVectorAxis
(
const FKey AxisKey |
Indicates that the InputComponent is interested in knowing/consuming a vector axis key's value (via GetVectorAxisKeyValue) but does not want a delegate function called each frame. | Components/InputComponent.h | |
FInputVectorAxisBinding & BindVectorAxis
(
const FKey AxisKey, |
Binds a delegate function to a vector axis key (e.g. Tilt) Returned reference is only guaranteed to be valid until another vector axis key is bound. | Components/InputComponent.h | |
virtual void ClearActionBindings () |
Removes all action bindings. | Components/InputComponent.h | |
void ClearAxisBindings() |
Removes all axis bindings. | Components/InputComponent.h | |
virtual void ClearBindingsForObject
(
UObject* InOwner |
Clears any input callback delegates from the given UObject | Components/InputComponent.h | |
void ClearBindingValues() |
Clears all cached binding values. | Components/InputComponent.h | |
void ConditionalBuildKeyMap
(
UPlayerInput* PlayerInput |
Components/InputComponent.h | ||
FInputActionBinding & GetActionBinding
(
const int32 BindingIndex |
Gets the action binding with the specified index. | Components/InputComponent.h | |
float GetAxisKeyValue
(
const FKey AxisKey |
Gets the current value of the axis with the specified key. | Components/InputComponent.h | |
float GetAxisValue
(
const FName AxisName |
Gets the current value of the axis with the specified name. | Components/InputComponent.h | |
int32 GetNumActionBindings () |
Gets the number of action bindings. | Components/InputComponent.h | |
FVector GetVectorAxisValue
(
const FKey AxisKey |
Gets the current vector value of the axis with the specified key. | Components/InputComponent.h | |
virtual bool HasBindings() |
Checks whether this component has any input bindings. | Components/InputComponent.h | |
void RemoveActionBinding
(
FName ActionName, |
Components/InputComponent.h | ||
void RemoveActionBinding
(
const int32 BindingIndex |
Removes the action binding at the specified index. | Components/InputComponent.h | |
void RemoveActionBinding
(
const FInputActionBinding& BindingToRemove, |
Removes the action binding (index need for multi-name fixups). | Components/InputComponent.h | |
void RemoveActionBindingForHandle
(
const int32 Handle |
Removes the action binding at the specified handle. | Components/InputComponent.h | |
void RemoveAxisBinding
(
const FName AxisName |
Removes the axis binding with the specified name. | Components/InputComponent.h | |
void RemoveAxisKeyBinding
(
const FKey AxisKey |
Removes the axis key binding with the specified key. | Components/InputComponent.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void LogDeprecatedBindingWarning
(
const FName BindingName |
Checks if the given action/axis binding name is deprecated. If it is, then log a warning. | Components/InputComponent.h |