RealDocs

UButton::OnPressed

property UMG Blueprint Since 4.0
#include "Components/Button.h"
Access: public Specifiers: UPROPERTYBlueprintAssignable

Description

Multicast event broadcast the moment the button is pressed down, before it's released.

Caveats & Gotchas

  • Fires independently of OnClicked — with the default DownAndUp click method, OnPressed fires on mouse-down and OnClicked only fires later on mouse-up over the button.
  • If the user presses and then drags off the button before releasing, OnPressed still fired but OnClicked will not.

Signature

UPROPERTY(BlueprintAssignable, Category="Button|Event")
FOnButtonPressedEvent OnPressed;

Example

Bind a native handler to OnPressed C++
MyButton->OnPressed.AddDynamic(this, &AMyHUD::HandleButtonPressed);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.