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
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?
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