-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Allow using Ctrl + Y to redo actions in the editor #47929
Conversation
This is already possible in TextEdit nodes (including the script editor), but this change allows using Ctrl + Y in the 2D and 3D editors as well. The existing Ctrl + Shift + Z shortcut is still available. Both shortcuts will remain supported to avoid breaking user expectations.
I don't know, wouldn't it be redundant to have both? I mean, I have never seen a program having both. IMO we should choose either one or the other and then make whatever uses the old shortcut use the new one. |
Technically, it's redundant, but here, I think the principle of least astonishment matters more. In 2021, applications still haven't settled on using a single redo shortcut. When an application supports only Ctrl + Y or Ctrl + Shift + Z, it'll break user expectations sooner or later. |
Ehhh... Honestly, for such a split shortcut astonishment wouldn't be that bad either, after all other applications have this issue too. I feel like anybody making games is kind of used to this. Look at blender, krita and vscode for example: they use ctrl + shift + z while other programs such as gimp and llms use ctrl + y. Maybe we could use the most common one by looking at what's used most in programs used in game development?
By that logic, I don't think choosing both is going to help with this issue. I'm still uncertain whether this PR is the right choice to make. I'll think about it. For now though, IMO this could be avoided, as pretty much the only affected users would be people completely inexperienced with computers if we go for the (less common in windows, but IMO superior) ctrl + shift + z route, but a quick read of the manual could fix this. Also, if the rebindable editor shortcuts PR got merged (has it?) one could choose by themselves which one to use, eliminating the problem altogheter. |
@Riteo Since Ctrl + Y isn't used for anything in the editor right now, I see no downside to supporting both shortcuts. |
@@ -409,6 +409,12 @@ void EditorNode::_unhandled_input(const Ref<InputEvent> &p_event) { | |||
if (ED_IS_SHORTCUT("editor/filter_files", p_event)) { | |||
filesystem_dock->focus_on_filter(); | |||
} | |||
if (k->get_command() && k->get_keycode() == KEY_Y) { |
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.
Any reason why we can't use if (k->is_action("ui_redo", true)) {
instead?
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.
@Paulb23 Wouldn't this cause the redo action to apply twice when pressing Ctrl + Shift + Z since there's also the ui_redo
shortcut that is being listened to?
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.
Shouldn't do as the popup menu will call accept_event
, though might need to also call that here.
This is assuming people haven't set shortcuts on their own. I know I have to reset some shortcuts every time Godot decides to change a default shortcut. |
I don't understand why this PR would be needed? |
@akien-mga Yes, text edit and such get multiple bindings for actions because they directly use the input map. Other parts of the editor use the |
Can this be closed? Just tested the editor and I can redo with both Ctrl + Shift + Z and Ctrl + Y. I think this PR has been long superceded by #51273. |
Superseded by #51273. |
This is already possible in TextEdit nodes (including the script editor), but this change allows using Ctrl + Y in the 2D and 3D editors as well.
The existing Ctrl + Shift + Z shortcut is still available. Both shortcuts will remain supported to avoid breaking user expectations.
I've done some quick testing and script editor redo still works as expected. Feel free to test this further locally 🙂
Before cherry-picking this to the
3.x
branch, remember that it uses a different shortcut handling system. I'd make sure to test this thoroughly on the3.x
branch before cherry-picking.