RealDocs

UKismetInputLibrary::ModifierKeysState_IsCommandDown

function Engine Blueprint Since unknown
#include "Kismet/KismetInputLibrary.h"
Access: public Specifiers: staticBlueprintPure

Description

Returns true if either the left or right Command key was held down when the modifier-key state snapshot was captured.

Caveats & Gotchas

  • On Windows and Linux there is no physical Command key, so this generally stays false — it's primarily meaningful on macOS.
  • Operates on a captured FSlateModifierKeysState snapshot, not a live poll — call GetModifierKeysState first to obtain a current snapshot.

Signature

static bool ModifierKeysState_IsCommandDown(const FSlateModifierKeysState& KeysState);

Parameters

Name Type Description Default
KeysState const FSlateModifierKeysState& The modifier-key state snapshot to test, typically obtained from GetModifierKeysState.

Return Type

bool

Example

Use Mac-style shortcut modifier C++
void UMyWidget::CheckModifiers()
{
    const FSlateModifierKeysState KeysState = UKismetInputLibrary::GetModifierKeysState();
    if (UKismetInputLibrary::ModifierKeysState_IsCommandDown(KeysState))
    {
        UseMacStyleShortcut();
    }
}

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.