A problem about On Mouse Leave Event in widget

I find that whenever I click my mouse button, this event “On Mouse Leave” will call back although my mouse pointer does not leave. How can I do?

Click on what? Widget gains focus and loses focus, it seems. More details will be needed.

1 Like

Include left、right、wheel button, they will make this event call back.

You will need to provide more details regarding the setup. What are we clicking on? From the description I can only tell you that the widget gains focus, if you want to crack it yourself, look into how it happens.

We know nothing about what is happening in your scene. You could have a full screen visible widget, or buttons that always consume click and reply unhandled.

Mouse enter this widget.


mouse left button:鼠标左键
mouse right button:鼠标右键

Mouse enter slot. When click,it shows:(print “hello”)

Is it enough? Thank you!

oh! I find the key problem. I should set “set input mode ui only”. Then it will not lose focus when I click mouse button.


But I still do not know why “set input mode game and UI” causes the widget lose focus when I click.

1 Like

Another question. While setting “Input mode UI and Game”, I long press mouse button and drag it, it will make charactor camera view move. It just like creating a new “thirdmanCharactor” project which set “show mouse cursor” √. If I want to move the camera view, I must click mouse button. Why is this?

Its not the input mode, you need to pass ‘handled’ into the return node OnMouseButtonDown

Can you tell me more? I didn’t find “handle”, thank you!

The return node where you have plugged in DetectDragIfPressed.

Copy and Paste that to your SpawnMenu, drag off the blue pin and type in Handled.

technically there is a return node for all your branch exits so you can decide if you want them all to be ‘handled’ or left ‘unhandled’