Hi,
So I’m making a widget system and I want the player to be able to right-click on a button (which is also a draggable button using left click). How would I check if the button was clicked with the right mouse button because it seems like the “On Clicked” event for a UMG button is only for left mouse clicks?
you need to write your oen function override for OnMouseDown.
In your BP Graph of the Widget, head over to the Variables panel… above… Macros… and above that… functions…
Don’t add a new function… instead, move the cursor a bit left of the “+” and you find the override dropdown. There, select the OnMouseDown.
in the new OnMouseDown override, take the mouse event and check with a “IsMouseButtonDown” Node, if the right mouse button has been triggered.
if yes, start th event/call the event dispatcher of your desire…
I just want to add that in most cases you want to do this with the on mouse double click function as well, if you don’t it wont let you register right clicking very fast at all which can also lead to right click not even being registered sometimes.
Thank you so much for this reply, I’ve been banging my head for two days about this issue and you just solved it for me!
You are very welcome, i was really confused about why it wasn’t registering the right click event very fast lol.