RealDocs

UButton::SetPressMethod

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

Description

Sets which keyboard or gamepad interaction pattern triggers the button's OnClicked event when it has focus.

Caveats & Gotchas

  • Only applies when the button is keyboard/gamepad-focusable — see IsFocusable; a non-focusable button never receives these inputs regardless of this setting.
  • Mirrors SetClickMethod's DownAndUp-vs-immediate distinction, but for the Accept/confirm input rather than the mouse.

Signature

UFUNCTION(BlueprintCallable, Category="Button")
UMG_API void SetPressMethod(EButtonPressMethod::Type InPressMethod);

Parameters

Name Type Description Default
InPressMethod EButtonPressMethod::Type How a keyboard/gamepad button press should trigger the button's click: DownAndUp or ButtonPress.

Return Type

void

Example

Trigger immediately on gamepad button press C++
MyButton->SetPressMethod(EButtonPressMethod::ButtonPress);

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.