RealDocs

UKismetInputLibrary::InputEvent_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 this input event occurred. On Windows this corresponds to the Windows key.

Caveats & Gotchas

  • On Windows, the OS frequently intercepts the Windows key for system shortcuts before it reaches the game, so relying on this cross-platform for a primary binding is unreliable.
  • Reflects modifier state at the moment the event fired, not a live poll of current key state.

Signature

static bool InputEvent_IsCommandDown(const FInputEvent& Input);

Parameters

Name Type Description Default
Input const FInputEvent& The input event to test.

Return Type

bool

Example

Mac-style shortcut modifier C++
FReply UMyWidget::NativeOnKeyDown(const FGeometry& InGeometry, const FKeyEvent& InKeyEvent)
{
    if (UKismetInputLibrary::InputEvent_IsCommandDown(InKeyEvent) && InKeyEvent.GetKey() == EKeys::S)
    {
        SaveDocument();
        return FReply::Handled();
    }
    return FReply::Unhandled();
}

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.