Skip to content

Conversation

@Yuxiang-Huang
Copy link

@Yuxiang-Huang Yuxiang-Huang commented Nov 21, 2025

Description

This PR implements proper node graph interaction aborting when pressing the Escape key (Esc) or the right mouse button (RMB). Specifically:

  • Pressing Esc or RMB during wire-dragging will now restore the original connection.
  • Pressing Esc or RMB during box selection will now restore the previous selection.
  • In both cases, pressing Esc or RMB will not exit the node graph mode.

Note: the aborting behavior using RMB is already implemented. This PR extends that functionality to the Escape key.

Code Change

In the NodeGraphMessageHandler struct, the following fields are now public to enable access from document_message_handler.rs:

  • box_selection_start
  • selection_before_pointer_down
  • wire_in_progress_type

I made this decision since existing fields such as drag_start is already public and used in document_message_handler.rs in a similar way.

In the Escape key handler in document_message_handler.rs, I add special handling for wire dragging and box selection aborting. The logic mirrors the existing implementation for right click in node_graph_message_handler.rs (lines 760–776)..

Demo Video

Google Drive link to the demo video. Unfortunately the video is too large to attach directly in the description.

Closes #2336

@Yuxiang-Huang Yuxiang-Huang marked this pull request as ready for review November 23, 2025 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proper node graph interaction aborting with Esc/RMB

1 participant