Replies: 2 comments 2 replies
-
I think it's just an oversight from when the code was initially written (note that the linked commit doesn't modify the check). That said, I'm not sure if remapping the right mouse button to We may want to introduce a dedicated built-in action for canceling drag-and-drop such as cc @Sauermann |
Beta Was this translation helpful? Give feedback.
2 replies
-
This got implemented in godotengine/godot#100259. I'm closing it accordingly. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Closely related to #4679
Currently when performing a drag operation, if I press a key mapped to
ui_cancel
it correctly cancels the drag as introduced in godotengine/godot#68418But if
ui_cancel
is mapped to a mouse button (e.g. right-click), it does not cancel the drag as I expected it would.I looked into the cpp code and saw in https://github.com/godotengine/godot/pull/68418/files#diff-7d37141bff1285fa01a0530677bdd0e2d07f1a3d6a9644b7eb5555807b8445c0R1970-R1976 that
mb.is_null()
is one of the checks.I believe
mb
refers to the mouse button index associated with the action, meaning that aui_cancel
originating from a mouse button won't be able to hit the_perform_drop
private method in this code.The only similar discussion I could find on the topic was #9044 which was implemented for the 4.3 milestone (apologies if unrelated, I'm still getting familiar) but you can't use
ui_cancel
on a mouse button to cancel a drag even in 4.3, so I don't think it affected the code in question.Is there a particular reason why
mb.is_null()
needs to be true in order to cancel the drop?Using right-click to cancel feels much more intuitive while mid-drag and my project involves dragging Controls (and sometimes cancelling the drag).
Beta Was this translation helpful? Give feedback.
All reactions