Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Change keyboard shortcut to access + z #10008
Second attempt at this after #9190 had to be reverted.
Changes the shortcut for remove block to access + z (ctrl + option + z on a Mac / shift + alt + z elsewhere).
This requires some cross browser testing. Please help if you can
How has this been tested?
Types of changes
Bug fix (non-breaking change which fixes an issue)
I'm sort of fine with us picking a keyboard shortcut at this point just to get things going.
Z does feel very very tied to "undo" though, so I'm not loving it. But I also don't have better suggestions if we can't use del or backspace keys.
On a separate note, but posting here because it's related to keyboard shortcuts, we've had long discussions about using keys that are physically located on a specific place on the keyboard. Like the key below escape, which happens to be a backtick on US keyboards but it's $ on a Danish one.
Could we use https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code to simplify this?
Thanks for the review feedback! I've tested IE and Edge, and they work fine.
It still also results in the issue where some keyboards might not have a particular key at all, rendering the shortcut unusable.
It's frustrating how difficult it is and I don't think there's a way to have one solution that fits all. When I've looked into how others have achieved it, they've often had to 'cheat' by mapping a single action to multiple keys and in some cases they also don't work very well.
We'd probably be better off making keyboard shortcuts remappable within Gutenberg, and maybe enabling different profiles that can be switched between (these could even be plugins).