[UMG] Right Mouse click on a button

Is there any way to fire OnClicked event, when I press RMB on a UMG Button?

Right now it fires only when i press Left mouse button, so i have to compare cursor position with button pos&scale in Character. Its not the best way to make, but I didn’t find any other way to do this yet.

1 Like

Conditions: cursor is over the button → true + right mouse button pressed event → true = umg button is pressed by right mouse click.

3 Likes

I do the same thing, but thank you for answering.

Hope Epic will add OnRightClick event to UMG button :slight_smile:

I’m also interest in OnRightClick Event, I’m currently using hover + right click event dispatcher, however when I right click and drag from one widget to another it thinks both are hovered.

Also interested in this.

Where is this “right click event dispatcher” of which you speak? I can’t find that node in my widget.

+1…

There is no “Rightclick Event dispatcher” I created a custom event dispatcher in my controller that’s fired off on right click. Then each widget receives the custom event dispatch it then checks if it’s “hovered” If true it executes that it’s been right clicked.

1 Like

thanks for explain!
it’s a little trick, but better than nothing

You can use “IsMouseButtonDown” upon the “Mouse Event” to see exactly which key triggered the event. This allows you to filter depending on if it is left or right.

Like this:

5 Likes

this is actually a better way than what is chosen as the answer

4 Likes

I’m still trying to figure out a way to make UMG notice right mouse drag so far no progress… :frowning:

This is how I do it.

4 Likes

On drag detected, but change the parameter from left mouse button to indicate that it is the right mouse button you are interested in. This works as intended. It works well. You can click and drag with left mouse, middle mouse, right mouse, ThumbMouseButton, ThumbMouseButton2, and also any of the KB keys…

I just made a boolean activate on right click on my player controller and deactivate on release, then cast to my player controller to get the boolean for the right click function, this way actually works, all the ones above this dont work anymore.

Still work even in UE5. Thanks!

1 Like


The image above is created from this video: UE4 Inventory And Crafting / Use and Drop from Right click menu - YouTube

This worked for me

The solutions didn’t really work for me (well I didn’t want to use event tick)

image
Another side note is On Preview Mouse Button Down is for left click and I guess On Mouse Button Down is for right click.

I’m using EU5