BUG: UMG OnMouseEnter does not trigger when mouse is locked to game window

Version: UE4.11.2 (Launcher) (Did not occur on 4.9 - 4.11.0)
Platform: Windows10
Occurs in Blank Project? Yes

After updating the editor to UE4.11.2, some widget functionality I had triggering ‘On Mouse Enter’ no longer functions correctly. I was able to track this down to when the mouse is locked to the client window (Which is apparently now by default or came along with another bug fix) so when pressing Shift+F1 and releasing the mouse, it began functioning correctly again.

Additional notes:

  • ‘On Mouse Leave’ triggers correctly when the mouse is or isn’t locked to the game window which makes me suspect this is a bug.
  • ‘On Mouse Enter’ does trigger when the mouse is locked to the game window, however this is ONLY when the mouse enters and a mouse button is currently being pressed.
  • Setting Input Mode Game and UI (Lock Mouse = False, Hide Mouse = False) in the player controller also fixes this issue (But this still looks like a bug)

Steps to Repro

  1. Start a Clean project. e.g. Blueprint Top Down Template.
  2. Create a new Blueprint widget.
  3. In the new Widgets ‘Designer’ window, add an image.
  4. In the Widget Graph, add ‘Event On Mouse Enter’ and a Print “Mouse Entered!”
  5. In the Player controller on Event Begin Play, create your new widget and add it to the players screen.
  6. Play in a standalone client (Mouse Locked to game window) and mouse over the Image. No print will occur.
  7. Press the mouse button down, and again mouse over the image. Print will occur.
  8. Press SHIFT+F1 (Mouse Unlocked to game window) and again mouse over the image and observe.

This issue became apparent when running the client in standalone mode, as the mouse is not locked when running new PIE windows. There are no logs or errors when this occurs.

Thanks!

Hello Prototype6143,

I was unable to reproduce this issue on our end. I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean project?
  2. If so, could you provide a detailed set of steps to reproduce this issue on our end?
  3. Could you provide screen shots of any blueprints that may be involved?

Hi Rudy!

As mentioned in my post, I was able to reproduce this on a clean (blank) project. The steps I also included are as detailed as they need to be to have issue occur on a clean project :slight_smile:

To make things easier, I have uploaded the clean project to google drive.(36mb) which you can find here: Google Drive: Sign-in

Please let me know if you need any further details!

Hello Prototype6143,

After testing the project provided. The issue appears to be because of the current input mode. You will need to make sure that the input mode is set to include UI. For example, you will need the input mode to be UI only or Game and UI. If you (just for the sake of testing) set input mode Game and UI on tick. You will see that you can move your character, the mouse can be locked, and the on mouse enter will still fire off. I hope that this information helps.

Make it a great day