Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/Components
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- UInputComponent
- UEnhancedInputComponent
References
| Module | Engine |
| Header | /Engine/Source/Runtime/Engine/Classes/Components/InputComponent.h |
| Include | #include "Components/InputComponent.h" |
Syntax
class UInputComponent : public UActorComponent
Remarks
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.
Variables
| Type | Name | Description | |
|---|---|---|---|
| TArray< FInputAxisBinding > | AxisBindings | The collection of axis bindings. | |
| TArray< FInputAxisKeyBinding > | AxisKeyBindings | The collection of axis key bindings. | |
| uint8: 1 | bBlockInput | Whether any components lower on the input stack should be allowed to receive input. | |
| TArray< FInputGestureBinding > | GestureBindings | The collection of gesture bindings. | |
| TArray< FInputKeyBinding > | KeyBindings | The collection of key bindings. | |
| int32 | Priority | The priority of this input component when pushed in to the stack. | |
| TArray< FInputTouchBinding > | TouchBindings | The collection of touch bindings. | |
| TArray< FInputVectorAxisBinding > | VectorAxisBindings | The collection of vector axis bindings. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UInputComponent
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| FInputActionBinding & | AddActionBinding
(
FInputActionBinding Binding |
Adds the specified action binding. | |
| FInputActionBinding & | BindAction
(
const FName ActionName, |
Binds a delegate function to an Action defined in the project settings. | |
| FInputActionBinding & | BindAction
(
const FName ActionName, |
Binds a delegate function to an Action defined in the project settings. | |
| FInputActionBinding & | BindAction
(
const FName ActionName, |
Binds a delegate function to an Action defined in the project settings. | |
| FInputAxisBinding & | Binds a delegate function an Axis defined in the project settings. | ||
| FInputAxisBinding & | Indicates that the InputComponent is interested in knowing the Axis value (via GetAxisValue) but does not want a delegate function called each frame. | ||
| FInputAxisKeyBinding & | BindAxisKey
(
const FKey AxisKey, |
Binds a delegate function for an axis key (e.g. Mouse X). | |
| 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. | |
| FInputGestureBinding & | BindGesture
(
const FKey GestureKey, |
Binds a gesture event to a delegate function. | |
| FInputKeyBinding & | BindKey
(
const FInputChord Chord, |
Binds a chord event to a delegate function. | |
| FInputKeyBinding & | Binds a key event to a delegate function. | ||
| FInputKeyBinding & | Binds a key event to a delegate function with key signature. | ||
| FInputTouchBinding & | BindTouch
(
const EInputEvent KeyEvent, |
Binds this input component to touch events. | |
| 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. | |
| 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. | |
| void | Removes all action bindings. | ||
| void | Removes all axis bindings. | ||
| void | ClearBindingsForObject
(
UObject* InOwner |
Clears any inut callback delegates from the given UObject | |
| void | Clears all cached binding values. | ||
| void | ConditionalBuildKeyMap
(
UPlayerInput* PlayerInput |
||
| FInputActionBinding & | GetActionBinding
(
const int32 BindingIndex |
Gets the action binding with the specified index. | |
| float | GetAxisKeyValue
(
const FKey AxisKey |
Gets the current value of the axis with the specified key. | |
| float | GetAxisValue
(
const FName AxisName |
Gets the current value of the axis with the specified name. | |
| int32 | Gets the number of action bindings. | ||
| FVector | GetVectorAxisValue
(
const FKey AxisKey |
Gets the current vector value of the axis with the specified key. | |
| bool | HasBindings () |
Checks whether this component has any input bindings. | |
| void | RemoveActionBinding
(
const int32 BindingIndex |
Removes the action binding at the specified index. | |
| void | RemoveActionBinding
(
const FInputActionBinding& BindingToRemove, |
Removes the action binding (index need for multi-name fixups). | |
| void | RemoveActionBinding
(
FName ActionName, |
Removes the action binding at the specified index. | |
| void | RemoveActionBindingForHandle
(
const int32 Handle |
Removes the action binding at the specified handle. | |
| void | RemoveAxisBinding
(
const FName AxisName |
Removes the axis binding with the specified name. |
See Also
https://docs.unrealengine.com/latest/INT/Gameplay/Input/index.html