-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change keyboard shortcut to access + z #10008
Conversation
Works fine for me on Antergos Linux using Firefox Beta and Chromium. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed it works and fixes the bug removing two blocks instead of one.
@jasmussen Thoughts on the chosen shortcut?
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. @jasmussen 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). |
Ah thanks for the answer. I read something about "scancodes" recently, and supposedly that could help us achieve what we wanted, but seems like there's no JS counterpart. |
Description
Fixes #9940
Fixes #9036
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).
Changes:
This requires some cross browser testing. Please help if you can 😄
How has this been tested?
https://docs.google.com/spreadsheets/d/1nK1frKawxV7aboWOJbbslbIqBGoLY7gqKvfwqENj2yE/edit?usp=sharing
Screenshots
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: