UButton::SetClickMethod
#include "Components/Button.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallable
Description
Sets which mouse interaction pattern triggers the button's OnClicked event.
Caveats & Gotchas
- • DownAndUp (the default) requires press-then-release over the button; MouseDown fires immediately on press without capturing the mouse; PreciseClick requires an exact press-and-release on the same widget, which matters inside scrollable lists.
- • Changing this affects mouse input only — see SetTouchMethod and SetPressMethod for touch and keyboard/gamepad equivalents.
Signature
UFUNCTION(BlueprintCallable, Category="Button")
UMG_API void SetClickMethod(EButtonClickMethod::Type InClickMethod); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InClickMethod | EButtonClickMethod::Type | How a mouse action should trigger the button's click: DownAndUp, MouseDown, or PreciseClick. | — |
Return Type
void Example
Fire on mouse-down instead of mouse-up C++
MyButton->SetClickMethod(EButtonClickMethod::MouseDown); Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?