-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Ctrl+Shift+Z
should restore data to the state that was before like Ctrl+Y
does
#5255
Comments
No, this has nothing to do with winit, and it's actually a bug in egui. The Ctrl+Shift+Z shortcut is supposed to work as redo as well: egui/crates/egui/src/widgets/text_edit/builder.rs Lines 997 to 1015 in 23728e1
But it doesn't, because the previous match arm (undo) is also triggered by this same key combination: egui/crates/egui/src/widgets/text_edit/builder.rs Lines 980 to 996 in 23728e1
This egui/crates/egui/src/data/input.rs Lines 769 to 786 in 23728e1
But it is being used incorrectly here, causing both Ctrl+Z and Ctrl+Shift+Z to work as undo. |
This code looks awful egui/crates/egui/src/widgets/text_edit/builder.rs Lines 1002 to 1004 in 23728e1
I would be better introduce a Shortcut struct which will incapsulate keys and modifiers. QShortcut is a good inspiration.
|
There is https://docs.rs/egui/0.29.1/egui/struct.KeyboardShortcut.html. Not sure why it isn't being used here. Maybe it was introduced later and this code was never refactored. But that is a separate issue. |
Is your feature request related to a problem? Please describe.
Well, I often use keybinding
Ctrl+Shift+Z
to restore text state after I accidentally undid too much changes usingCtrl+Z
. In egui controls, e.g. text edit,Ctrl+Shift+Z
doesn't behave like rest of such inputs in my system (Windows 10).Describe the solution you'd like
Ctrl+Shift+Z
keybinding should do redo operation, likeCtrl+Y
does.Describe alternatives you've considered
Do nothing and tell users to use
Ctrl+Y
. It works on egui controls.Additional context
Well, I use computers the biggest part of my life and always used
Ctrl+Shift+Z
to cancelCtrl+Z
. Only when opening this issue, I checked if this is actually standardized and found that there exists aCtrl+Y
keybinding. I think, it is common for users to be like me so supporting bothCtrl+Y
andCtrl+Shift+Z
would be convenient for them.Maybe, it is a wrong repository to report this and I should report it to winit, I don't really know.
The text was updated successfully, but these errors were encountered: