-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Keyboard: automatically reload mapping file and update tooltips + menubar accelerators #13082
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
base: main
Are you sure you want to change the base?
Conversation
|
oh, need to consider skin reload... edit: Done. |
c41be0a to
6896dc8
Compare
6896dc8 to
428caf9
Compare
Done. |
428caf9 to
7f055f3
Compare
|
We could add dummy shortcuts (empty) to all currently unmapped menubar actions so users can add shortcuts themselves. Nothing that holds up this PR though. |
7f055f3 to
4583b2d
Compare
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.
Not too important, but the upper/lowercasing of KeyboardEventFIlter got a bit mixed up the commit message Keyboard: handle mapping file and config setting in KeyboardEventFIlter`.
|
This one has a conflict now. Can we remove the 2.5-beta milestone? |
|
Sure, assigned it to 2.5 for now because I think this is a bugfix, see #9814 Set to draft because I've just rebased this and am about to tweak it considering @cr7pt0gr4ph7's suggestions. |
4583b2d to
61db431
Compare
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.
Small nitpick: Spelling of "chnanged" in the commit message. LGTM otherwise.
61db431 to
0b63ef6
Compare
|
Thanks for taking the time to review!
Yeah, that happens when I work in bright sunlight... |
bf5ed1b to
234e419
Compare
234e419 to
c4dbddb
Compare
5b04405 to
569b17e
Compare
|
I was very grateful this works as desired when my controllers Play buttons ceased to work during my last live session. |
|
@acolombier and @Swiftb0y can you have a final look here? Are your comments sufficiently fixed? |
acolombier
left a comment
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.
Looking good, haven't retested again! Just a small Q around connections with lambda capture, but all 👍 otherwise.
| QStringList shortcutHints; | ||
| for (auto* pWidget : std::as_const(m_widgets)) { | ||
| QString keyString; | ||
| shortcutHints.clear(); |
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.
Nit - move shortcutHints declaration to this scope instead?
| UserSettingsPointer m_pConfig; | ||
| QAction* m_pViewKeywheel; | ||
| ConfigObject<ConfigValueKbd>* m_pKbdConfig; | ||
| // TODO KeyboardEventFilterPointer ?? |
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.
Is this still TODO? If yes, could you elaborate it a bit further?
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.
Not necessarily. Will remove it.
I just noticed that I typed std::shared_ptr<KeyboardEventFilter> a few times and wondered if we could add a wrapper/typedef KeyboardEventFilterPointer like we have for the settings
(typedef QWeakPointer<UserSettings> UserSettingsWeakPointer;)
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.
I think that makes sense indeed!
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.
I tried it, but I think it's not worth it because (like i did it) the forward-declarations won't suffice anymore and it requires extra header includes. Here's a test commit 06bf4cd
656d200 to
8d45955
Compare
|
Thanks @acolombier for your review, I think I fixed everything. If all's good I'd like to squash the small fixups -- not 100% sure how well that goes with the intermediate merge commits. Can as well rebase onto main, just to have a clean history. |
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.
Looking good!
IIRC, you should be able to rebase this to the latest head you merged in (9e947aec194aeb9a0f74330d1ad16b27e8bc1b83 by the looks of it?) and it should drop the merge commit from the history
git rebase --autosquash -i 9e947aec194aeb9a0f74330d1ad16b27e8bc1b83
Edit: looks like CI is failing on Windows
|
yeah, all builds are failing because of a conflict, and there is a mismatch between local and this, idk where that comes from. |
c7fee5f to
de7aa54
Compare
…gled or mapping file changed
956cf22 to
db5708e
Compare
Yeeiij, finally!
When keyboard shortcuts are toggled On/Off, the widget tooltips are adjusted accordingly.
When the keyboard mapping file has been changed (or removed), tooltips and the mapping are rebuilt.
Same applies to menubar shortcuts.
As before, we look for the user's
Custom.kbd.cfgfirst, then use the built-in mapping based on the selected locale.Inspired by #1746, but implemented more simply.
Replaces #13074
Fixes #9814
Update for the Manual is mixxxdj/manual#735