Skip to content

Cancel the current drag-and-drop operation when pressing Escape while dragging something #4679

@Calinou

Description

@Calinou

Related to #3420.

Describe the project you are working on

The Godot editor 🙂

Describe the problem or limitation you are having in your project

Unlike most applications, Godot doesn't allow canceling a drag-and-drop operation by pressing Escape while the mouse button is still held down.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Pressing Escape should cancel any ongoing drag-and-drop operation, whether it's a node in the Scene tree dock or a file/folder in the FileSystem dock.

Most other applications such as file managers and web browsers allow pressing Escape to cancel the existing drag-and-drop operation, if any. This also applies to text editing fields, so we should make sure this behavior is also present in LineEdit and TextEdit in Godot.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

This should probably apply universally, including to projects' use of drag-and-drop functionality. I don't see an use case where you'd need to prevent canceling drag-and-drop when pressing Escape, but feel free to comment if you do.

If this enhancement will not be used often, can it be worked around with a few lines of script?

This is probably already feasible with a script, but it won't affect the editor.

Is there a reason why this should be core and not an add-on in the asset library?

This is about improving editor usability, but also the usability of projects using drag-and-drop functionality (mainly non-game applications made with Godot).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Implemented

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions