Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[4.13.0] Event On Mouse Leave doesn't fire when holding the mouse button down

As the title says, the blueprint event On Mouse Leave doesn't fire when you press the widget and hold the mouse button down when moving the cursor out of the widget. The On Mouse Leave event will never be fired then.

If your code relies on the Mouse Enter/Leave events to detect whether the mouse is above it or not, which mine does, it will create a very buggy experience.

You also have the Is Hovered function, but it suffers from the same bug as the events do.

This bug wasn't happening in 4.11, it is a bug introduced in 4.12 or 4.13.

Product Version: UE 4.13
more ▼

asked Sep 02 '16 at 01:29 PM in Blueprint Scripting

avatar image

105 6 9 14

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey Zwarmapapa-

Based on the answer provided here (https://answers.unrealengine.com/questions/409186/bug-umg-onmouseenter-does-not-trigger-when-mouse-i.html ) I found that adding the "Set Input Mode UI Only" node to dictate how the widget reads the input will allow the Mouse Enter / Leave events to fire correctly.


Doug Wilson

more ▼

answered Sep 02 '16 at 06:00 PM

avatar image Zwarmapapa Sep 04 '16 at 11:36 AM

Please re-read my post. The input mode is already being set to UI, and mouse enters are working correctly in my case. I am experiencing a bug where mouse leave isn't working correctly if you are holding the mouse button down during the mouse leave. Again, this bug didn't exist in 4.11, it appeared in either 4.12 or 4.13.

avatar image Doug E ♦♦ STAFF Sep 06 '16 at 09:33 PM

With the setup shown below my On Mouse Leave and OnUnhovered events would trigger even if the mouse button was held.

alt text

Can you post a screenshot of the setup you're using and also let me know if this setup works for what you're intending to do?

uimode.png (158.7 kB)
avatar image Zwarmapapa Sep 07 '16 at 01:33 PM

I went through the trouble to make a new project that contains this bug.

In the project, mouse over and leave the white square and it will show Enter and Leave.

Mouse over the white square and hold the mouse button down when leaving it and it will never show Leave.

This bug didn't happen in 4.11 by the way.

This bug is of importance to me since I've created every widget I use myself in blueprint, like buttons and checkboxes for example. I did this to have the maximum amount of control over them and to be able to do things that I wouldn't be able to do with normal buttons and checkboxes etc. With this bug, my entire UI bugs out when someone drags the mouse out of a widget, which makes the game way to buggy to be released. Luckily I'm still a couple months away from finishing the game, but nonetheless, I would like to have this fixed as soon as possible.

Anyway, maybe I forgot to do something critical which wasn't necessary in 4.11 but is in 4.13, but I have no idea what that would be.

I've also tried the Left Mouse Button solution you've posted in your screenshot, but the thing is, is that the mouse enter/leave events don't work when the input mode is UI only (edit: this turned out to not be true, apparently just keeping the mouse button pressed causes the events to not be fired). I've kept the code in the project so you can see it for yourself. Press [B] on the keyboard to enable/disable your Left Mouse Button solution.

avatar image Doug E ♦♦ STAFF Sep 07 '16 at 08:05 PM

I have entered a report for the On Mouse Enter, On Mouse Leave, OnHovered, and OnUnhovered events behavior with the mouse button held that can be viewed and voted on here: https://issues.unrealengine.com/issue/UE-35687 .

Given your sample project, you should be able to add a Get Player Controller node where you are setting the Input Mode UI Only temporarily.

avatar image Zwarmapapa Sep 08 '16 at 12:40 PM

Thanks for adding the bug report.

Apparently, the problem only happens when the input mode is [Game and UI]. When the input mode is [UI Only], it doesn't bug. This wasn't put in the bug report, so I'll post it here.

Also, I've found a working hotfix: just place every custom widget in a transparent padding-less button, and then use the button hover events (which do work correctly) for your hover code.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question