RealDocs

UKismetInputLibrary::PointerEvent_IsMouseButtonDown

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

Description

Returns true if the specified mouse button was held down at the time of this pointer event.

Caveats & Gotchas

  • Checks the button state captured with this specific event, not a live poll — call this from within a pointer event handler such as NativeOnMouseMove.
  • Passing a non-mouse FKey (e.g. a keyboard key) simply returns false rather than asserting.

Signature

static bool PointerEvent_IsMouseButtonDown(const FPointerEvent& Input, FKey MouseButton);

Parameters

Name Type Description Default
Input const FPointerEvent& The pointer event to test.
MouseButton FKey The mouse button key to test, e.g. EKeys::LeftMouseButton.

Return Type

bool

Example

Pan a viewport while right mouse button is held C++
FReply UMyWidget::NativeOnMouseMove(const FGeometry& InGeometry, const FPointerEvent& InMouseEvent)
{
    if (UKismetInputLibrary::PointerEvent_IsMouseButtonDown(InMouseEvent, EKeys::RightMouseButton))
    {
        PanViewport(UKismetInputLibrary::PointerEvent_GetCursorDelta(InMouseEvent));
    }
    return FReply::Handled();
}

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.