-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add Cmd+W close shortcut (on Mac) to more dialogs #3905
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
Add Cmd+W close shortcut (on Mac) to more dialogs #3905
Conversation
|
ctrl+w to close a window would be nice to have on other OSs as well, not just for mac in my opinion. |
Actually that sounds more than reasonable! I am not very knowledgeable about other operating systems and their UI patterns (and it would be a bit harder for me to test) but perhaps we could un-Mac-ify this one (and remove explicit Lines 991 to 996 in ccab18b
|
|
I probably can't really help with the programming site of things, but I can test your proposed solution on debian linux (sid). |
3bc253d to
8a6e4ef
Compare
Here’s the branch: https://github.com/beyondcompute/anki/tree/make-ctrl_w-keyboard-shorcut-work-on-win-and-linux . (It includes changes for this PR as well. 🤷♂️) I hope, someone who is really familiar with Anki and its multiple views and dialogs can test those thoroughly. Also, we’d obviously need a Windows tester. 🪟😳 |
|
I tested it on debian linux (sid) using this branch:
Results:
(7 work, 11 do not work) I think I tested all dialogs. |
|
Some investigation notes. 📝
|
|
@GithubAnon0000 I’ve added the shortcut to more dialogs and updated the branch. I also removed hiding of “close action” on other (non-Mac) systems. Let’s see, how that looks. Not sure if any of this will get merged. 😄 Also something like #3913 perhaps would be nice to have. |
d91015f to
fefdb7e
Compare
|
I can test it again if you want me to. Just keep in mind that I'd need a week or two, as my schedule is quite busy right now. |
|
Thank you! Happy to add the shortcut to any screens that are missing it, provided we don't introduce regressions. Some notes:
|
Is that the default for windows? In linux Ctrl+w is pretty much normal (I never even heard of Alt+F4). Maybe the Edit: Alt+F4 does exist on linux (at least on gnome). It closes the entire window though, unlike Ctrl+w. That's especially noticable when apps have tabs. |
|
@dae the change in |
fefdb7e to
2c5f188
Compare
In Linux (and Windows), Ctrl+W is usually reserved for application with tabbed views for closing a single tab (which may cause the whole application to be closed when the last open tab is closed, depending on how it's implemented) |
- The camelCase variant will remain accessible with a warning. - The removed setattr line is legacy cruft, and wasn't doing anything.
|
Merging this in for now, but a global approach like mentioned on #3913 (review) is probably the better longer-term solution. |
As I’ve been editing decks more often, I noticed that editor dialogs don’t respond to Cmd+W keyboard shortcut. Here’s an attempt to add the shortcut to “Edit Current”, “Fields” and “Cards” editor dialogs. And also to several modals.