Drag & Drop Widget disappears after pressing ESC

Hey guys,

is there a function which delegates key events while a Drag & Drop Operation is currently active?

My Widgets just disappears when I press Escape while drag and dropping it.
I hoped my NativeOnDragCancelled function would be called but this is not the case :confused:

Thanks in advance for your answers

Greetings

Hello McStrife,

I’m encountering the same issue in 4.18.1. When I press escape my drag and drop operation disappears and Drag Cancelled is not being called leaving me unable to handle the event. Were you able to solve this on your own somehow?

Unfortunately not. :frowning:

If it is of any help, I was able to solve this with a workaround.

Instead of removing the original widget from the parent when D&D operation begins, I keep it in place and unchanged until OnDrop is registered for the operation, and only then perform all the necessary changes. In this case I don’t need any extra logic on Cancel events and cancelling via Escape becomes no different to any other way of cancelling the drag.
The original widget is used as a payload for the D&D operation so it can be easily referenced.

The only downside I see is visual, as the widget stays in the original place while the operation is ongoing. In my case I made the D&D visual slightly transparent to make it stand out from the original widget and that was it.

You could duplicate the Widget. Attach it the the D&D Op and make the original wiget invisible.
If you drop it anywhere else you delete the original widget. That could be one way to do it.

My problem is that I don’t get any D&D event when ESC is pressed (while dragging). I filled the OnDragCancelled function but unfortunately it won’t be called :frowning:

Same behavior on my side. 4.18.1

The same issue here. I press ESC while drag&dropping and corresponding drag&drop widget disappearch. UE 4.18.3

Lol. Same on 4.19.2
Is it possible to use On key event to resolve this?

4.21.1 The problem still remains.

1 Like

Looks like it’s a very old bug and devs gave up on it?
There must be way to override esc key during drag and write my own implementation