# SetMouseCursorWidget only works when I release mouse press

**URL:** <https://forums.unrealengine.com/t/setmousecursorwidget-only-works-when-i-release-mouse-press/2776064>\
**Category:** C++\
**Tags:** cursor, unreal-engine, Widget, CPP, question\
**Created:** [September 15, 2026, 7:37pm UTC](https://forums.unrealengine.com/t/setmousecursorwidget-only-works-when-i-release-mouse-press/2776064 "2026-09-15T19:37:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arwimiles](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Arwimiles](https://forums.unrealengine.com/u/Arwimiles)\
**Post date:** [September 15, 2026, 7:37pm UTC](https://forums.unrealengine.com/t/setmousecursorwidget-only-works-when-i-release-mouse-press/2776064/1 "2026-09-15T19:37:24Z")

</div>

Hello! I’m working on drag and drop functionality for an inventory system. I want to SetMouseCursorWidget to the widget of an item if you’ve clicked it and dragged, however it instead just hides the cursor and only shows the widget when I release the mouse click.

It functions correctly if I use this line in the NativeOnMouseButtonDown of the widget it clicked and dragged on:

```auto
FReply::Handled().CaptureMouse(TakeWidget());

```

instead of

```auto
FReply::Handled();

```

However if the mouse is captured it doesn’t register the NativeOnMouseButtonUp that I need called on a different widget.

I don’t know much about mouse capturing so I apologize if this is a silly question, but I can’t find an answer online.

---

<div class="post-metadata">

**Author:** ![SolarflareSoft](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/solarflaresoft/32/1192396_2.png) [@SolarflareSoft](https://forums.unrealengine.com/u/SolarflareSoft)\
**Post date:** [September 16, 2026, 12:59am UTC](https://forums.unrealengine.com/t/setmousecursorwidget-only-works-when-i-release-mouse-press/2776064/2 "2026-09-16T00:59:09Z")

</div>

My first thought on the matter is: if you’re handling drag-and-drop, why are you using NativeOnMouseButtonUp instead of NativeOnDrop?

I’m not sure whether that’ll solve your problem, but it’s worth a try.

---

<div class="post-metadata">

**Author:** ![Arwimiles](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Arwimiles](https://forums.unrealengine.com/u/Arwimiles)\
**Post date:** [September 16, 2026, 1:54am UTC](https://forums.unrealengine.com/t/setmousecursorwidget-only-works-when-i-release-mouse-press/2776064/3 "2026-09-16T01:54:38Z")

</div>

I’m not using the built in drag and drop functionality, I’m doing it myself. From what I understand, the built in system would move the widget itself, when I want to keep the widget we selected in the same position and instead create a new widget that is assigned to the cursor. And only after NativeOnMouseUp does the original widget, along with the one on our cursor, disappear.

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [September 16, 2026, 3:38am UTC](https://forums.unrealengine.com/t/setmousecursorwidget-only-works-when-i-release-mouse-press/2776064/4 "2026-09-16T03:38:05Z")

</div>

its been a while since ive done it so i can only point you in the direction but i believe CaptureMouse returns a handle that you can save and use. So rather than OnMouseUp you use the handle, or maybe OnMouseUp-\>IsHandleValid-\>Release

if that doesnt help ill see if i can find my old code

---

<div class="post-metadata">

**Author:** ![Arwimiles](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Arwimiles](https://forums.unrealengine.com/u/Arwimiles)\
**Post date:** [September 16, 2026, 12:05pm UTC](https://forums.unrealengine.com/t/setmousecursorwidget-only-works-when-i-release-mouse-press/2776064/5 "2026-09-16T12:05:30Z")

</div>

Thank you, I will try this and report back

---

<div class="post-metadata">

**Author:** ![Arwimiles](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Arwimiles](https://forums.unrealengine.com/u/Arwimiles)\
**Post date:** [September 16, 2026, 1:12pm UTC](https://forums.unrealengine.com/t/setmousecursorwidget-only-works-when-i-release-mouse-press/2776064/6 "2026-09-16T13:12:13Z")

</div>

I’m sorry I’m not quite sure I understand. To save the handle do I broadcast the FReply to the widget I need to receive the input? How can I use a handle instead of OnMouseUp?

I can’t seem to find much documentation on this mouse stuff.

---

<div class="post-metadata">

**Author:** ![SparkleBoom](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sparkleboom/32/1203454_2.png) [@SparkleBoom](https://forums.unrealengine.com/u/SparkleBoom)\
**Post date:** [September 16, 2026, 3:58pm UTC](https://forums.unrealengine.com/t/setmousecursorwidget-only-works-when-i-release-mouse-press/2776064/7 "2026-09-16T15:58:21Z")

</div>

@Arwimiles

I think there might be a misunderstanding about how Unreal’s native UMG Drag & Drop system works.  
It doesn’t force you to move the original widget, what happens visually and logically is completely under your control.

For instance, during a drag operation you can:

- Keep the original widget untouched in its original slot.
- Create a lightweight “ghost” widget that follows the cursor as a preview.
- Temporarily grey out, hide, or change the icon of the source widget.
- Spawn a completely custom visual element without altering the underlying UI structure.

Here is how the native UMG workflow handles mouse routing and drop detection automatically:

- **`NativeOnMouseButtonDown`** : Instead of manually capturing the mouse, you return `FReply::Handled().DetectDrag(TakeWidget(), EKeys::LeftMouseButton);`.

- **`NativeOnDragDetected`** : Called when the engine detects mouse movement after the click. Here you create a `UDragDropOperation` and set your custom ghost/preview widget to `DefaultDragVisual`.

- **`UDragDropOperation`** : Acts as a container to carry any custom payload data (e.g., Item ID, slot index, quantity) from the source to the target widget.

- **`NativeOnDrop`** : Called automatically on the receiving widget where the mouse button is released. It receives the `UDragDropOperation` payload so you can execute whatever logic you need (swapping items, dropping items, updating slots, etc.).

Using this native flow solves your mouse capture issue completely because Slate handles routing the drop event to whichever widget is under the cursor when the drag ends.

I’d also recommend checking out this official guide (unfortunatly Blueprint only but the concept is the same in c++) [Creating Drag and Drop UI](https://dev.epicgames.com/documentation/unreal-engine/creating-drag-and-drop-ui-in-unreal-engine)

In that example, the widget is moved, but as you can see, it’s only moved because the tutorial author explicitly chose to do so in their logic, not because Unreal forces that behavior natively.

---

<div class="post-metadata">

**Author:** ![Arwimiles](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Arwimiles](https://forums.unrealengine.com/u/Arwimiles)\
**Post date:** [September 16, 2026, 4:00pm UTC](https://forums.unrealengine.com/t/setmousecursorwidget-only-works-when-i-release-mouse-press/2776064/8 "2026-09-16T16:00:25Z")

</div>

You are correct, I did misunderstand it and I will be switching to using the built in drag and drop system. I still would love to know what about my system was causing such an odd bug, just for peace of mind. Regardless, I believe drag and drop will fix it, thank you!

---

<div class="post-metadata">

**Author:** ![SparkleBoom](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sparkleboom/32/1203454_2.png) [@SparkleBoom](https://forums.unrealengine.com/u/SparkleBoom)\
**Post date:** [September 16, 2026, 4:10pm UTC](https://forums.unrealengine.com/t/setmousecursorwidget-only-works-when-i-release-mouse-press/2776064/9 "2026-09-16T16:10:28Z")

</div>

Regarding your issue with `SetMouseCursorWidget`, the behavior you’re seeing is caused by how Slate handles **Mouse Capture** and input routing:

- When you call `CaptureMouse(TakeWidget())`, Slate routes **all** subsequent mouse events (movement, button up, mouse enter/leave) exclusively to the widget that initiated the capture. Because that widget holds full ownership of the mouse, no other widget under the cursor will ever receive `NativeOnMouseButtonUp`.

- `SetMouseCursorWidget` depends on Slate’s active widget context. When you press and hold the mouse button without mouse capture (or without an active Drag & Drop framework operation), Slate considers the mouse clicked on the initial widget. As soon as the cursor leaves that widget’s bounds, Slate stops updating that widget’s software cursor, causing it to hide until you release the click and input focus resets.

So basically, it’s not a bug, it’s just working as intended by Slate’s design.
