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

#include <Events.h>

+ Inheritance diagram for FKeyEvent:

Public Member Functions

SLATECORE_API FKeyEvent ()
 
SLATECORE_API FKeyEvent (const FKey InKey, const FModifierKeysState &InModifierKeys, const uint32 InUserIndex, const bool bInIsRepeat, const uint32 InCharacterCode, const uint32 InKeyCode)
 
SLATECORE_API FKeyEvent (const FKey InKey, const FModifierKeysState &InModifierKeys, const FInputDeviceId InDeviceId, const bool bInIsRepeat, const uint32 InCharacterCode, const uint32 InKeyCode, const TOptional< int32 > InOptionalSlateUserIndex=TOptional< int32 >())
 
virtual SLATECORE_API ~FKeyEvent ()
 
FKey GetKey () const
 
uint32 GetCharacter () const
 
uint32 GetKeyCode () const
 
virtual SLATECORE_API FText ToText () const override
 
virtual SLATECORE_API bool IsKeyEvent () const override
 
- Public Member Functions inherited from FInputEvent
 FInputEvent ()
 
 FInputEvent (const FModifierKeysState &InModifierKeys, const int32 InUserIndex, const bool bInIsRepeat)
 
 FInputEvent (const FModifierKeysState &InModifierKeys, const FInputDeviceId InDeviceId, const bool bInIsRepeat)
 
virtual SLATECORE_API ~FInputEvent ()
 
bool IsRepeat () const
 
bool IsShiftDown () const
 
bool IsLeftShiftDown () const
 
bool IsRightShiftDown () const
 
bool IsControlDown () const
 
bool IsLeftControlDown () const
 
bool IsRightControlDown () const
 
bool IsAltDown () const
 
bool IsLeftAltDown () const
 
bool IsRightAltDown () const
 
bool IsCommandDown () const
 
bool IsLeftCommandDown () const
 
bool IsRightCommandDown () const
 
bool AreCapsLocked () const
 
const FModifierKeysStateGetModifierKeys () const
 
uint32 GetUserIndex () const
 
FInputDeviceId GetInputDeviceId () const
 
FPlatformUserId GetPlatformUserId () const
 
uint64 GetEventTimestamp () const
 
double GetMillisecondsSinceEvent () const
 
SLATECORE_API FGeometry FindGeometry (const TSharedRef< SWidget > &WidgetToFind) const
 
SLATECORE_API TSharedRef< SWindowGetWindow () const
 
void SetEventPath (const FWidgetPath &InEventPath)
 
const FWidgetPathGetEventPath () const
 
virtual SLATECORE_API bool IsPointerEvent () const
 

Additional Inherited Members

- Protected Attributes inherited from FInputEvent
FModifierKeysState ModifierKeys
 
bool bIsRepeat
 
uint32 UserIndex
 
FInputDeviceId InputDeviceId
 
const FWidgetPathEventPath
 
uint64 EventTimestamp
 

Detailed Description

FKeyEvent describes a key action (keyboard/controller key/button pressed or released.) It is passed to event handlers dealing with key input.

Constructor & Destructor Documentation

◆ FKeyEvent() [1/3]

FKeyEvent::FKeyEvent ( )

UStruct Constructor. Not meant for normal usage.

◆ FKeyEvent() [2/3]

FKeyEvent::FKeyEvent ( const FKey  InKey,
const FModifierKeysState InModifierKeys,
const uint32  InUserIndex,
const bool  bInIsRepeat,
const uint32  InCharacterCode,
const uint32  InKeyCode 
)

Constructor. Events are immutable once constructed.

Parameters
InKeyNameCharacter name
InModifierKeysModifier key state for this event
bInIsRepeatTrue if this key is an auto-repeated keystroke

◆ FKeyEvent() [3/3]

FKeyEvent::FKeyEvent ( const FKey  InKey,
const FModifierKeysState InModifierKeys,
const FInputDeviceId  InDeviceId,
const bool  bInIsRepeat,
const uint32  InCharacterCode,
const uint32  InKeyCode,
const TOptional< int32 InOptionalSlateUserIndex = TOptional<int32>() 
)

◆ ~FKeyEvent()

FKeyEvent::~FKeyEvent ( )
virtualdefault

Member Function Documentation

◆ GetCharacter()

uint32 FKeyEvent::GetCharacter ( ) const
inline

Returns the character code for this event.

Returns
Character code or 0 if this event was not a character key press

◆ GetKey()

FKey FKeyEvent::GetKey ( ) const
inline

Returns the name of the key for this event

Returns
Key name

◆ GetKeyCode()

uint32 FKeyEvent::GetKeyCode ( ) const
inline

Returns the key code received from hardware before any conversion/mapping.

Returns
Key code received from hardware

◆ IsKeyEvent()

bool FKeyEvent::IsKeyEvent ( ) const
overridevirtual

Is this event a key event.

Reimplemented from FInputEvent.

◆ ToText()

FText FKeyEvent::ToText ( ) const
overridevirtual

Reimplemented from FInputEvent.

Reimplemented in FAnalogInputEvent.


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