Skip to content

Conversation

@ronso0
Copy link
Member

@ronso0 ronso0 commented Apr 10, 2024

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.cfg first, 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

@github-actions github-actions bot added the ui label Apr 10, 2024
@ronso0 ronso0 added this to the 2.5-beta milestone Apr 10, 2024
@ronso0
Copy link
Member Author

ronso0 commented Apr 10, 2024

oh, need to consider skin reload...

edit: Done.

@ronso0 ronso0 force-pushed the kbd-mapping-reload-tooltip-update branch 2 times, most recently from c41be0a to 6896dc8 Compare April 11, 2024 23:03
@ronso0 ronso0 marked this pull request as ready for review April 14, 2024 22:29
@ronso0 ronso0 force-pushed the kbd-mapping-reload-tooltip-update branch from 6896dc8 to 428caf9 Compare April 15, 2024 18:54
@ronso0
Copy link
Member Author

ronso0 commented Apr 15, 2024

Extending this to WMainMenuBar, as done in #1746, is certainly possibly.

Done.

@ronso0
Copy link
Member Author

ronso0 commented Apr 16, 2024

We could add dummy shortcuts (empty) to all currently unmapped menubar actions so users can add shortcuts themselves.
(i.e. add ConfigKeys to menubar and all *.kbd.cfg files)

Nothing that holds up this PR though.

Copy link
Contributor

@cr7pt0gr4ph7 cr7pt0gr4ph7 left a 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`.

@daschuer
Copy link
Member

daschuer commented May 1, 2024

This one has a conflict now. Can we remove the 2.5-beta milestone?

@ronso0 ronso0 marked this pull request as draft May 1, 2024 15:20
@ronso0 ronso0 modified the milestones: 2.5-beta, 2.5.0 May 1, 2024
@ronso0
Copy link
Member Author

ronso0 commented May 1, 2024

Sure, assigned it to 2.5 for now because I think this is a bugfix, see #9814
It can either slip in during the beta period (it's already working without issues), or later.

Set to draft because I've just rebased this and am about to tweak it considering @cr7pt0gr4ph7's suggestions.

@ronso0 ronso0 force-pushed the kbd-mapping-reload-tooltip-update branch from 4583b2d to 61db431 Compare May 1, 2024 16:47
Copy link
Contributor

@cr7pt0gr4ph7 cr7pt0gr4ph7 left a 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.

@ronso0 ronso0 force-pushed the kbd-mapping-reload-tooltip-update branch from 61db431 to 0b63ef6 Compare May 3, 2024 10:25
@ronso0
Copy link
Member Author

ronso0 commented May 3, 2024

Thanks for taking the time to review!

Spelling of "chnanged" in the commit message.

Yeah, that happens when I work in bright sunlight...

@ronso0 ronso0 marked this pull request as ready for review May 3, 2024 10:26
@daschuer daschuer modified the milestones: 2.5.0, 2.5-beta May 8, 2024
@ronso0 ronso0 force-pushed the kbd-mapping-reload-tooltip-update branch 3 times, most recently from bf5ed1b to 234e419 Compare May 9, 2025 22:22
@ronso0 ronso0 changed the title Keyboard: automatically reload mapping file and update tooltips Keyboard: automatically reload mapping file and update tooltips + menubar accelerators May 9, 2025
@ronso0 ronso0 force-pushed the kbd-mapping-reload-tooltip-update branch from 234e419 to c4dbddb Compare May 9, 2025 22:56
@ronso0 ronso0 linked an issue May 24, 2025 that may be closed by this pull request
@ronso0 ronso0 force-pushed the kbd-mapping-reload-tooltip-update branch from 5b04405 to 569b17e Compare October 25, 2025 14:10
@ronso0
Copy link
Member Author

ronso0 commented Oct 28, 2025

I was very grateful this works as desired when my controllers Play buttons ceased to work during my last live session.
I quickly assigned 1 and 2 to play, saved the mapping and could continue my set.

@daschuer
Copy link
Member

@acolombier and @Swiftb0y can you have a final look here? Are your comments sufficiently fixed?

Copy link
Member

@acolombier acolombier left a 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();
Copy link
Member

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 ??
Copy link
Member

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?

Copy link
Member Author

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;)

Copy link
Member

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!

Copy link
Member Author

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

@ronso0 ronso0 force-pushed the kbd-mapping-reload-tooltip-update branch from 656d200 to 8d45955 Compare January 28, 2026 00:28
@ronso0
Copy link
Member Author

ronso0 commented Jan 28, 2026

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.

Copy link
Member

@acolombier acolombier left a 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

@ronso0
Copy link
Member Author

ronso0 commented Jan 28, 2026

yeah, all builds are failing because of a conflict, and there is a mismatch between local and this, idk where that comes from.
I'll backup and try to rebase locally, first without the fixups. Let's see how that goes..

@ronso0 ronso0 force-pushed the kbd-mapping-reload-tooltip-update branch from c7fee5f to de7aa54 Compare February 2, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Need testing

Development

Successfully merging this pull request may close these issues.

allow to refresh custom keyboard configuration without restart show keyboard shortcuts in tooltip instantly after enabling shortcuts

6 participants