How set UMG button as pressed from BP script?

Hi,
in (widget) Blueprint what is the command to activate a UMG button (like if it was clicked).

I have an actionbar with 3 umg buttons. In the actionbar script Im listening for keys like if I press 1 the first umg button should activate. I have the listening part done (atm I just printstring from widget key 1…2…3… pressed) and it works good.

Now instead of the printstring I make a custom event and then I get “actionbar slot 1” → Button but here I don’t know what to call to simulate the button is clicked. What function should I use from the button?

Thanks

Just connect a custom event to the same place as the button clicked event, and call that. ( I don’t think there is a ‘button clicked’ fake event. )

Like @ClockworkOcean mentioned - there’s no fake event for pressing buttons

If you wanna have the functionality both from clicking the buttons and pressing keyboard keys - add a custom event to the beginning of the code (where you have the event OnButtonClicked) and run it as you press the responsible keys

Fake click simulation is possible only via Widget Component + Widget interaction but it’s something different from what you need but you can take a look on that for learning purposes ;]

Hi,
sorry for my late reply.

Thanks to both of you.

I used “Listen for input action” and ran the onkeypress code through a custom event.