UKismetInputLibrary::GetModifierKeysState
#include "Kismet/KismetInputLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Returns a snapshot of the current modifier-key state (Shift, Ctrl, Alt, Command) for the application, independent of any specific input event.
Caveats & Gotchas
- • Queries the live, cached application-wide modifier state rather than the state captured at a specific input event — use the InputEvent_Is*Down functions instead if you need the state tied to a particular key or pointer event.
- • Only reflects modifier keys on the local machine running the Slate application; it is not replicated or network-aware.
Signature
static FSlateModifierKeysState GetModifierKeysState(); Return Type
FSlateModifierKeysState Example
Log the current modifier state C++
void UMyWidget::LogCurrentModifiers()
{
const FSlateModifierKeysState KeysState = UKismetInputLibrary::GetModifierKeysState();
const bool bShift = UKismetInputLibrary::ModifierKeysState_IsShiftDown(KeysState);
const bool bCtrl = UKismetInputLibrary::ModifierKeysState_IsControlDown(KeysState);
UE_LOG(LogTemp, Log, TEXT("Shift=%d Ctrl=%d"), bShift, bCtrl);
} See Also
Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?