RealDocs

UKismetInputLibrary::PointerEvent_GetEffectingButton

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

Description

Returns the specific mouse button that caused this pointer event to be raised, or FKey::Invalid if the event wasn't triggered by a button.

Caveats & Gotchas

  • Returns FKey::Invalid for plain move events with no button transition — always check IsValid() before comparing it against a specific key.
  • For move events where multiple buttons are held, this reflects only the button that triggered the event — use PointerEvent_IsMouseButtonDown to test other buttons.

Signature

static FKey PointerEvent_GetEffectingButton(const FPointerEvent& Input);

Parameters

Name Type Description Default
Input const FPointerEvent& The pointer event to read the triggering button from.

Return Type

FKey

Example

Open a context menu on right-click C++
FReply UMyWidget::NativeOnMouseButtonDown(const FGeometry& InGeometry, const FPointerEvent& InMouseEvent)
{
    const FKey Button = UKismetInputLibrary::PointerEvent_GetEffectingButton(InMouseEvent);
    if (Button == EKeys::RightMouseButton)
    {
        OpenContextMenu();
        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.