Developer Notes

Don't think we'll fix this, it's only good for visible slate widgets to prevent the game from doing stuff. It's possible we should look for some new flag to distinguish those from visible and visible but non-blocking.


Licensee is adding a widget to the viewport overlay via AddViewportWidgetContent(). The widget receives mouse input when hovered. They return unhandled from all their widget's onmouse functions and expect to see ActorBeginCursorOver, ActorEndCursorOver and ActorOnClicked events on the primitive component underneath the pointer.

What they actually see:
1) When bEnableMouseOverEvents=true the cursor over events occur but only when the mouse is clicked. Kind of makes sense that the mouse over doesn't bubble up through something just because it isn't handling stuff. I don't think we handle/unhandle the mouse enter/exit messages.
2) When bEnableMouseOverEvents=true ActorOnClicked is never seen, only the mouse over events. Seems like the ClickedPrimitive in APlayerController::InputKey() is determined differently when bEnableMouseOverEvents is set and it isn't being set when there's a widget in the way.
3) When bEnableMouseOverEvents=false the ActorOnClicked event comes through fine. Its code path in APlayerController::InputKey is different.

Steps to Reproduce
  1. Open UE4 Editor (any project)
  2. Add Widget Blueprint (MyWidget)
  3. Remove default Canvas Panel from Hierarchy and replace with Overlay
  4. Add Border to Hierarchy under Overlay
  5. Under Slot heading in the details panel, set Horizontal/Vertical Alignment to fill
  6. Select the white bar next to Brush Color and set the Alpha to 0.2
  7. Create an event for OnMouseButtonDown
  8. In the new function, Add Unhandled node and wire into Return Value
  9. Set other mouse events to use this function
  10. Create a new Blueprint based on Actor
  11. Add Static Mesh Component and set static mesh to 1M_Cube
  12. in EventGraph, add GetPlayerController node and wire into Set Show Mouse Cursor and Set Enable Mouse Over Events nodes.
  13. Wire Event Begin Play into both Set nodes
  14. Add even nodes for Actor Begin Cursor Over and Actor End Cursor Over
  15. Wire each event into a Print String node.
  16. Add instance of the blueprint to the level
  17. Open Level Blueprint
  18. Add Create Widget node and set class to MyWidget
  19. Wire the Return Value into an Add to Viewport node
  20. Add Event BeginPlay node to wire into the Create Widget node.
  21. PIE

The widget will cover the entire screen and moving the mouse over the BP instance does not show the print string messages for the begin nor end cursor over events. With the mouse hovering over the cube, clicking LMB will print both begin and end messages.

When set to unhandled, mouse can interact with both the widget as well as the game world beneath the widget.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-25033 in the post.

Login to Vote

Won't Fix
ComponentUE - Editor - UI Systems - Slate
Affects Versions4.10
CreatedJan 7, 2016
ResolvedMar 15, 2016
UpdatedJul 14, 2021