UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FInputKeyEventArgs Struct Reference

#include <InputKeyEventArgs.h>

Public Member Functions

 FInputKeyEventArgs ()=default
 
ENGINE_API FInputKeyEventArgs (FViewport *InViewport, const FInputDeviceId InInputDevice, const FKey &InKey, const EInputEvent InEvent, const float InAmountDepressed, const bool bInIsTouchEvent, const uint64 InEventTimestamp)
 
 FInputKeyEventArgs (FViewport *InViewport, FInputDeviceId InInputDevice, FKey InKey, EInputEvent InEvent, float InAmountDepressed, bool bInIsTouchEvent)
 
 FInputKeyEventArgs (FViewport *InViewport, const FInputDeviceId InInputDevice, const FKey &InKey, const EInputEvent InEvent, const uint64 InEventTimestamp)
 
 FInputKeyEventArgs (FViewport *InViewport, FInputDeviceId InInputDevice, FKey InKey, EInputEvent InEvent)
 
 FInputKeyEventArgs (FViewport *InViewport, const FInputDeviceId InInputDevice, const FKey &InKey, const float InDelta, const float InDeltaTime, const int32 InNumSamples, const uint64 InEventTimestamp)
 
 FInputKeyEventArgs (FViewport *InViewport, int32 InControllerId, FKey InKey, EInputEvent InEvent, float InAmountDepressed, bool bInIsTouchEvent)
 
 FInputKeyEventArgs (FViewport *InViewport, int32 InControllerId, FKey InKey, EInputEvent InEvent)
 
bool IsGamepad () const
 
bool IsSimulatedInput () const
 
ENGINE_API FPlatformUserId GetPlatformUser () const
 

Static Public Member Functions

static ENGINE_API FInputKeyEventArgs CreateSimulated (const FKey &InKey, const EInputEvent InEvent, const float AmountDepressed, const int32 InNumSamplesOverride=-1, const FInputDeviceId InputDevice=INPUTDEVICEID_NONE, const bool bIsTouchEvent=false, FViewport *Viewport=nullptr)
 

Public Attributes

FViewportViewport = nullptr
 
int32 ControllerId
 
FInputDeviceId InputDevice = INPUTDEVICEID_NONE
 
FKey Key = {}
 
EInputEvent Event = IE_MAX
 
float AmountDepressed
 
float DeltaTime = 1.0f / 60.f
 
int32 NumSamples = 1
 
bool bIsTouchEvent = false
 
uint64 EventTimestamp = 0u
 

Detailed Description

Input key event arguments. This is data that is required for the viewport client to process input via its InputKey/InputAxis functions.

It represents a single "input event" which has happened which we want game or editor code to be able to process. This may accumulate several "raw" input events from the message handler into one with multiple sample readings, or it could be just one single key press event.

This data can represent gamepad, keyboard, mouse, or touch data.

Constructor & Destructor Documentation

◆ FInputKeyEventArgs() [1/8]

FInputKeyEventArgs::FInputKeyEventArgs ( )
default

◆ FInputKeyEventArgs() [2/8]

FInputKeyEventArgs::FInputKeyEventArgs ( FViewport InViewport,
const FInputDeviceId  InInputDevice,
const FKey InKey,
const EInputEvent  InEvent,
const float  InAmountDepressed,
const bool  bInIsTouchEvent,
const uint64  InEventTimestamp 
)

Construct a FInputKeyEventArgs based on data acquired from the Slate input events. These event args are used to translate from Slate input event arguments into a standardized form for the ViewportClient and then the rest of the gameplay framework.

Parameters
InViewportThe viewport which the axis movement is from.
InInputDeviceThe input device that triggered this axis movement
InKeyThe name of the axis which moved.
InEventThe key event that these args represent.
InAmountDepressedFor axis events, the amount that the key is depressed
bInIsTouchEventTrue if this event represents a touch input
InEventTimestampThe timestamp of when this input event was originally polled in the form of CPU cycles.

◆ FInputKeyEventArgs() [3/8]

FInputKeyEventArgs::FInputKeyEventArgs ( FViewport InViewport,
FInputDeviceId  InInputDevice,
FKey  InKey,
EInputEvent  InEvent,
float  InAmountDepressed,
bool  bInIsTouchEvent 
)
inline

◆ FInputKeyEventArgs() [4/8]

FInputKeyEventArgs::FInputKeyEventArgs ( FViewport InViewport,
const FInputDeviceId  InInputDevice,
const FKey InKey,
const EInputEvent  InEvent,
const uint64  InEventTimestamp 
)
inline

Constrcut a FInputKeyEventArgs based on data acquired from the Slate input events. These event args are used to translate from Slate input event arguments into a standardized form for the ViewportClient and then the rest of the gameplay framework.

Parameters
InViewportThe viewport which the axis movement is from.
InInputDeviceThe input device that triggered this axis movement
InKeyThe name of the axis which moved.
InEventThe key event that these args represent.
InEventTimestampThe timestamp of when this input event was originally polled in the form of CPU cycles.

◆ FInputKeyEventArgs() [5/8]

FInputKeyEventArgs::FInputKeyEventArgs ( FViewport InViewport,
FInputDeviceId  InInputDevice,
FKey  InKey,
EInputEvent  InEvent 
)
inline

◆ FInputKeyEventArgs() [6/8]

FInputKeyEventArgs::FInputKeyEventArgs ( FViewport InViewport,
const FInputDeviceId  InInputDevice,
const FKey InKey,
const float  InDelta,
const float  InDeltaTime,
const int32  InNumSamples,
const uint64  InEventTimestamp 
)
inline

Construct a FInputKeyEventArgs based on the old params of the ViewportClient InputAxis function.

Parameters
InViewportThe viewport which the axis movement is from.
InInputDeviceThe input device that triggered this axis movement
InKeyThe name of the axis which moved.
InDeltaThe axis movement delta.
InDeltaTimeThe time since the last axis update.
InNumSamplesThe number of device samples that contributed to this Delta, useful for things like smoothing
InEventTimestampThe timestamp of when this input event was originally polled in the form of CPU cycles.

◆ FInputKeyEventArgs() [7/8]

FInputKeyEventArgs::FInputKeyEventArgs ( FViewport InViewport,
int32  InControllerId,
FKey  InKey,
EInputEvent  InEvent,
float  InAmountDepressed,
bool  bInIsTouchEvent 
)
inline

◆ FInputKeyEventArgs() [8/8]

FInputKeyEventArgs::FInputKeyEventArgs ( FViewport InViewport,
int32  InControllerId,
FKey  InKey,
EInputEvent  InEvent 
)
inline

Member Function Documentation

◆ CreateSimulated()

FInputKeyEventArgs FInputKeyEventArgs::CreateSimulated ( const FKey InKey,
const EInputEvent  InEvent,
const float  AmountDepressed,
const int32  InNumSamplesOverride = -1,
const FInputDeviceId  InputDevice = INPUTDEVICEID_NONE,
const bool  bIsTouchEvent = false,
FViewport Viewport = nullptr 
)
static

◆ GetPlatformUser()

FPlatformUserId FInputKeyEventArgs::GetPlatformUser ( ) const
Returns
The platform user which this input event originated from based on its input device.

◆ IsGamepad()

bool FInputKeyEventArgs::IsGamepad ( ) const
inline
Returns
True if this input event is for a Gamepay key, or should be treated as such.

This may be true for non-gamepad FKeys if the input event is simulated input.

◆ IsSimulatedInput()

bool FInputKeyEventArgs::IsSimulatedInput ( ) const
inline

Member Data Documentation

◆ AmountDepressed

float FInputKeyEventArgs::AmountDepressed

The value that this input event represents.

For analog keys, the depression percent.

◆ bIsTouchEvent

bool FInputKeyEventArgs::bIsTouchEvent = false

True if this input event originated from a touch surface.

Note: This may be set to true for simulated touch inputs from things like a mouse button.

◆ ControllerId

int32 FInputKeyEventArgs::ControllerId

◆ DeltaTime

float FInputKeyEventArgs::DeltaTime = 1.0f / 60.f

The time between the previous frame and the current one

◆ Event

EInputEvent FInputKeyEventArgs::Event = IE_MAX

The type of event which occurred.

◆ EventTimestamp

uint64 FInputKeyEventArgs::EventTimestamp = 0u

The timestamp of when this input event was originally polled.

This data should be set to be as representative as possible of the time of when the input event originated, most of the time from the raw Slate input event (FInputEvent) on the message handler.

This timestamp is in terms of CPU Cycles, gathered from the platform's high resolution clock via the FPlatformTime::Cycles64() function.

A timestamp value of 0u means that this event was not initalized with a valid timestamp

◆ InputDevice

FInputDeviceId FInputKeyEventArgs::InputDevice = INPUTDEVICEID_NONE

The input device which this event originated from.

◆ Key

FKey FInputKeyEventArgs::Key = {}

The Key that this input event is for

◆ NumSamples

int32 FInputKeyEventArgs::NumSamples = 1

For analog key events. The number of samples of analog input which are contained in this events InputValue.

◆ Viewport

FViewport* FInputKeyEventArgs::Viewport = nullptr

The viewport from which this key event originated from.

This viewport may be null if this input event is from a simulated source, such as a unit test or a widget simulating player input.


The documentation for this struct was generated from the following files: