# Current mouse cursor during drag operation

**URL:** <https://forums.unrealengine.com/t/current-mouse-cursor-during-drag-operation/384538>\
**Category:** UI\
**Tags:** cursor, drag-and-drop, unreal-engine, Widget, question\
**Created:** [February 10, 2017, 2:34pm UTC](https://forums.unrealengine.com/t/current-mouse-cursor-during-drag-operation/384538 "2017-02-10T14:34:24Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_5882066e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5882066e](https://forums.unrealengine.com/u/anonymous_user_5882066e)\
**Post date:** [February 10, 2017, 2:34pm UTC](https://forums.unrealengine.com/t/current-mouse-cursor-during-drag-operation/384538/1 "2017-02-10T14:34:24Z")

</div>

Hi,

I’ve implemented Drag & Drop for one widget blueprint using a DragDropOperation object. This is working nice but the player controller always uses the default mouse cursor during the dragging. Even when it’s not the default cursor specified in the player controller.

Does anyone have an idea how to change this? I’ve tried setting the current mouse cursor in the OnDragDetected event but this doesn’t work.

---

<div class="post-metadata">

**Author:** ![guyglies205](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@guyglies205](https://forums.unrealengine.com/u/guyglies205)\
**Post date:** [August 30, 2019, 7:30pm UTC](https://forums.unrealengine.com/t/current-mouse-cursor-during-drag-operation/384538/2 "2019-08-30T19:30:15Z")

</div>

I have the same problem. I have found this:

FCursorReply FDragDropOperation::OnCursorQuery()  
{  
if ( MouseCursorOverride.IsSet() )  
{  
return FCursorReply::Cursor( MouseCursorOverride.GetValue() );  
}

```
	if ( MouseCursor.IsSet() )
	{
		return FCursorReply::Cursor(MouseCursor.GetValue());
	}

	return FCursorReply::Unhandled();
}

FCursorReply FUMGDragDropOp::OnCursorQuery()
{
	FCursorReply CursorReply = FGameDragDropOperation::OnCursorQuery();

	if ( !CursorReply.IsEventHandled() )
	{
		CursorReply = CursorReply.Cursor(EMouseCursor::Default);
	}

```

Problem is that the Blueprint DragAndDropOperation is a UDragAndDropOperation and not a FDragAndDropOperation so we have no way to override the mouse cursor… Maybe it will help you.

---

<div class="post-metadata">

**Author:** ![Kakushi\_52](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kakushi\_52](https://forums.unrealengine.com/u/Kakushi_52)\
**Post date:** [January 17, 2024, 5:41am UTC](https://forums.unrealengine.com/t/current-mouse-cursor-during-drag-operation/384538/3 "2024-01-17T05:41:43Z")

</div>

I have the same problem, and I don’t think there is any workaround, so I fixed it by modifying the engine code.  
Here is my pull request.  
[https://github.com/EpicGames/UnrealEngine/pull/11337/](https://github.com/EpicGames/UnrealEngine/pull/11337/)

---

<div class="post-metadata">

**Author:** ![Macarmoni](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Macarmoni](https://forums.unrealengine.com/u/Macarmoni)\
**Post date:** [February 25, 2024, 1:42pm UTC](https://forums.unrealengine.com/t/current-mouse-cursor-during-drag-operation/384538/4 "2024-02-25T13:42:40Z")

</div>

In project settings there is an option for setting the cursor design using a widget. Making this empty also can ‘hide’ the cursor. (‘Empty’ being the created widgetbp)

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/a/36a641ca337f34359eb979c4a16532444febca5c.png)

---

<div class="post-metadata">

**Author:** ![Axyzz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Axyzz](https://forums.unrealengine.com/u/Axyzz)\
**Post date:** [February 28, 2024, 12:45am UTC](https://forums.unrealengine.com/t/current-mouse-cursor-during-drag-operation/384538/5 "2024-02-28T00:45:57Z")

</div>

and in the case of just using the standard cursor, when dragging a widget I would like it to change to the hand cursor and when releasing it to return to the default, I tried to do it here but when I try to drag it continues with the default cursor then after I release it it changes to the hand cursor

---

<div class="post-metadata">

**Author:** ![Younong](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Younong](https://forums.unrealengine.com/u/Younong)\
**Post date:** [April 25, 2024, 1:02pm UTC](https://forums.unrealengine.com/t/current-mouse-cursor-during-drag-operation/384538/6 "2024-04-25T13:02:48Z")

</div>

Have you solved it?

---

<div class="post-metadata">

**Author:** ![Axyzz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Axyzz](https://forums.unrealengine.com/u/Axyzz)\
**Post date:** [April 27, 2024, 9:16pm UTC](https://forums.unrealengine.com/t/current-mouse-cursor-during-drag-operation/384538/7 "2024-04-27T21:16:45Z")

</div>

I couldn’t find a solution. The only thing I did was do as my friend Macarmoni said, put a transparent cursor in place of the default in the game settings and when the game starts change the cursor to a secondary one so that it is not always transparent, only when dragging and dropping, it’s a gimmick unfortunately 😕

---

<div class="post-metadata">

**Author:** ![Axyzz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Axyzz](https://forums.unrealengine.com/u/Axyzz)\
**Post date:** [May 3, 2024, 3:25pm UTC](https://forums.unrealengine.com/t/current-mouse-cursor-during-drag-operation/384538/8 "2024-05-03T15:25:18Z")

</div>

the link is down, can you help us?

---

<div class="post-metadata">

**Author:** ![BlackJeanBar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BlackJeanBar](https://forums.unrealengine.com/u/BlackJeanBar)\
**Post date:** [September 12, 2024, 11:36pm UTC](https://forums.unrealengine.com/t/current-mouse-cursor-during-drag-operation/384538/10 "2024-09-12T23:36:26Z")

</div>

I found out ! You just have to “set hardware cursor” during your drag and it will change  
 ![2024-09-13_01h33_48](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/6/8/f686089ce0cd16b9f30a804656713a22ad667858.png)

Follow [this link](https://www.youtube.com/watch?v=3oSXhCeuu1Q&t=37s) to know more about hardware cursor.

It worked perfectly for me

---

<div class="post-metadata">

**Author:** ![goldensyrupgames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@goldensyrupgames](https://forums.unrealengine.com/u/goldensyrupgames)\
**Post date:** [November 2, 2024, 7:56am UTC](https://forums.unrealengine.com/t/current-mouse-cursor-during-drag-operation/384538/11 "2024-11-02T07:56:23Z")

</div>

Easier fix: in `FUMGDragDropOp::OnCursorQuery()` it uses `SourceUserWidgetPtr`’s overriden pointer if it exists (the object you’re starting the drag from). So enable the checkbox to override the cursor on that widget, then set the overriden cursor to whatever you want it to be at various stages. GrabHand when the mouse enters, Default when it leaves, GrabHandClosed when the drag is triggered, etc.

---

<div class="post-metadata">

**Author:** ![hotinnards](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hotinnards/32/1049084_2.png) [@hotinnards](https://forums.unrealengine.com/u/hotinnards)\
**Post date:** [November 2, 2024, 3:39pm UTC](https://forums.unrealengine.com/t/current-mouse-cursor-during-drag-operation/384538/12 "2024-11-02T15:39:05Z")

</div>

This is the function to use.

When using hardware cursors, make sure the cursor file is not an imported .uasset, you need the files in the correct directory, but not actually imported to the engine.

Go to Project Settings → Engine - User Interface → Hardware Cursors and define a directory where your cursor images are stored. Use your game name (content root folder) for the relative path.

 ![HardwareCursors](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/4/784b7c7af509c17d65548cb575a31c9687f5c5d9.png)

For example, you need cursor\_hand.png not cursor\_hand.uasset. The png file will not actually be visible in the content browser in engine, but can be read this way. No need to add the file extension for the function call either, just the name.

 ![SetHardwareCursor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/0/6/7061f707005b0e67fa35c80b78d78469f22349e2.png)

Finally, make sure to add your hardware cursor directory to be cooked when packaging your project.

Project Settings → Packaging → Additional Non-Asset Directories to Package

![Packaging](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/3/6/1366921389834d2a37522976978aa9a3e21914de.png)

From the cursor path tooltip, you can also just add a Slate directory for your cursor files since that will always be cooked.

 ![PathTooltip](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/1/3/e13a446a8f32256d9ee7978bbdf29542f1752274.png)

---

<div class="post-metadata">

**Author:** ![Lenka\_Pitonakova](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lenka_pitonakova/32/986979_2.png) [@Lenka\_Pitonakova](https://forums.unrealengine.com/u/Lenka_Pitonakova)\
**Post date:** [April 15, 2025, 4:25pm UTC](https://forums.unrealengine.com/t/current-mouse-cursor-during-drag-operation/384538/13 "2025-04-15T16:25:50Z")

</div>

You can simply use the C++ / Blueprint function SetCursor when drag is detected E.g., in C++

```auto
void MyClass:NativeOnDragDetected(const FGeometry& geometry_, const FPointerEvent& mouseEvent_, UDragDropOperation*& outOperation_) {
   //-- create your drag operation ...

   //-- set cursor
   SetCursor(EMouseCursor::Type::GrabHandClosed);
}

```
