google / blockly-samples

Plugins, codelabs, and examples related to the Blockly library.
http://github.com/google/blockly
Apache License 2.0
838 stars 617 forks source link

Keyboard navigation plugin unregister/re-register copy/cut/paste shortcuts #2424

Open changminbark opened 3 months ago

changminbark commented 3 months ago

Check for duplicates

Component

Keyboard Navigation Plugin

Problem

Currently, when combining the keyboard navigation plugin with the multiselect plugin, the copy/cut/paste shortcuts overlap. That is why the multiselect mode unregisters its copy/cut/paste shortcuts when the keyboard navigation mode is on and re-registers it when the keyboard navigation mode is turned off. However, this leads to an issue where the user cannot use the original copy/cut/paste shortcuts with the cursor while the keyboard navigation mode is on.

Request

One of the solutions to this would be to introduce a way to unregister/re-register the keyboard navigation plugin's copy/cut/paste shortcuts. That way, we can unregister/re-register the original Blockly core's copy/cut/paste shortcuts without running into a collision error.

More information regarding the issue from the multiselect side: https://github.com/mit-cml/workspace-multiselect/issues/50#issuecomment-2250364202

image

Alternatives considered

The alternative solution to this would be to allow the original Blockly core's copy/cut/paste shortcuts to allow for collisions. However, this solution seems less elegant.

Additional context

No response

BeksOmega commented 2 months ago

Heya @changminbark Thank you for reporting =) This is something we'll keep in mind as we test and refactor keyboard navigation! But I wouldn't consider compatibility with keyboard nav a blocker for your multiselect work. Keyboard nav is still a beta plugin, that we don't think is well suited to users yet.