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

#include <InputChord.h>

Public Types

enum class  ERelationshipType { None , Same , Masked , Masks }
 

Public Member Functions

SLATE_API ERelationshipType GetRelationship (const FInputChord &OtherChord) const
 
SLATE_API FInputChord ()
 
 FInputChord (const FKey InKey)
 
 FInputChord (const FKey InKey, const bool bInShift, const bool bInCtrl, const bool bInAlt, const bool bInCmd)
 
 FInputChord (const EModifierKey::Type InModifierKeys, const FKey InKey)
 
 FInputChord (const FKey InKey, const EModifierKey::Type InModifierKeys)
 
 FInputChord (const FInputChord &Other)=default
 
 FInputChord (FInputChord &&Other)=default
 
FInputChordoperator= (const FInputChord &Other)=default
 
FInputChordoperator= (FInputChord &&Other)=default
 
bool operator== (const FInputChord &Other) const
 
bool operator!= (const FInputChord &Other) const
 
bool NeedsControl () const
 
bool NeedsCommand () const
 
bool NeedsAlt () const
 
bool NeedsShift () const
 
SLATE_API FText GetInputText (const bool bLongDisplayName=true) const
 
SLATE_API FText GetKeyText (const bool bLongDisplayName=true) const
 
SLATE_API FText GetModifierText (TOptional< FText > ModifierAppender=TOptional< FText >()) const
 
bool HasAnyModifierKeys () const
 
bool IsValidChord () const
 
void Set (const FInputChord &InTemplate)
 

Public Attributes

FKey Key
 
uint32 bShift:1
 
uint32 bCtrl:1
 
uint32 bAlt:1
 
uint32 bCmd:1
 

Friends

uint32 GetTypeHash (const FInputChord &Chord)
 

Detailed Description

An Input Chord is a key and the modifier keys that are to be held with it.

Member Enumeration Documentation

◆ ERelationshipType

The ways two chords can be related to each other. A chord is considered masking when it has all the same modifier keys as another chord plus more.

Enumerator
None 
Same 
Masked 
Masks 

Constructor & Destructor Documentation

◆ FInputChord() [1/7]

FInputChord::FInputChord ( )

◆ FInputChord() [2/7]

FInputChord::FInputChord ( const FKey  InKey)
inline

◆ FInputChord() [3/7]

FInputChord::FInputChord ( const FKey  InKey,
const bool  bInShift,
const bool  bInCtrl,
const bool  bInAlt,
const bool  bInCmd 
)
inline

◆ FInputChord() [4/7]

FInputChord::FInputChord ( const EModifierKey::Type  InModifierKeys,
const FKey  InKey 
)
inline

Creates and initializes a new instance.

Parameters
InKey
InModifierKeys

◆ FInputChord() [5/7]

FInputChord::FInputChord ( const FKey  InKey,
const EModifierKey::Type  InModifierKeys 
)
inline

Creates and initializes a new instance.

Parameters
InKey
InModifierKeys

◆ FInputChord() [6/7]

FInputChord::FInputChord ( const FInputChord Other)
default

Copy constructor.

Parameters
Other

◆ FInputChord() [7/7]

FInputChord::FInputChord ( FInputChord &&  Other)
default

Move constructor.

Parameters
Other

Member Function Documentation

◆ GetInputText()

FText FInputChord::GetInputText ( const bool  bLongDisplayName = true) const

Gets a localized string that represents the chord.

Returns
A localized string.

Returns the friendly, localized string name of this key binding

◆ GetKeyText()

FText FInputChord::GetKeyText ( const bool  bLongDisplayName = true) const

Gets the key represented as a localized string.

Returns
A localized string.

◆ GetModifierText()

FText FInputChord::GetModifierText ( TOptional< FText ModifierAppender = TOptional<FText>()) const

Gets the localized string for the modifier portion of the coord.

Parameters
ModifierAppender.Text to append between each modifier and the key. If this is not specified a '+' character will be used

◆ GetRelationship()

FInputChord::ERelationshipType FInputChord::GetRelationship ( const FInputChord OtherChord) const

Returns the relationship between this chord and another.

◆ HasAnyModifierKeys()

bool FInputChord::HasAnyModifierKeys ( ) const
inline

Checks whether this chord requires an modifier keys to be pressed.

Returns
true if modifier keys must be pressed, false otherwise.

◆ IsValidChord()

bool FInputChord::IsValidChord ( ) const
inline

Determines if this chord is valid. A chord is valid if it has a non modifier key that must be pressed and zero or more modifier keys that must be pressed

Returns
true if the chord is valid

◆ NeedsAlt()

bool FInputChord::NeedsAlt ( ) const
inline

◆ NeedsCommand()

bool FInputChord::NeedsCommand ( ) const
inline

◆ NeedsControl()

bool FInputChord::NeedsControl ( ) const
inline

◆ NeedsShift()

bool FInputChord::NeedsShift ( ) const
inline

◆ operator!=()

bool FInputChord::operator!= ( const FInputChord Other) const
inline

Compares this input chord with another for inequality.

Parameters
OtherThe other chord to compare with.
Returns
true if the chords are equal, false otherwise.

◆ operator=() [1/2]

FInputChord & FInputChord::operator= ( const FInputChord Other)
default

Copy assignment operator.

Parameters
Other

◆ operator=() [2/2]

FInputChord & FInputChord::operator= ( FInputChord &&  Other)
default

Move assignment operator.

Parameters
Other

◆ operator==()

bool FInputChord::operator== ( const FInputChord Other) const
inline

Compares this input chord with another for equality.

Parameters
OtherThe other chord to compare with.
Returns
true if the chords are equal, false otherwise.

◆ Set()

void FInputChord::Set ( const FInputChord InTemplate)
inline

Sets this chord to a new key and modifier state based on the provided template Should not be called directly. Only used by the key binding editor to set user defined keys

Friends And Related Symbol Documentation

◆ GetTypeHash

uint32 GetTypeHash ( const FInputChord Chord)
friend

Gets a type hash value for the specified chord.

Parameters
ChordThe input chord to get the hash value for.
Returns
The hash value.

Member Data Documentation

◆ bAlt

uint32 FInputChord::bAlt

Whether the alt key is part of the chord.

◆ bCmd

uint32 FInputChord::bCmd

Whether the command key is part of the chord.

◆ bCtrl

uint32 FInputChord::bCtrl

Whether the control key is part of the chord.

◆ bShift

uint32 FInputChord::bShift

Whether the shift key is part of the chord.

◆ Key

FKey FInputChord::Key

The Key is the core of the chord.


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