-
-
Notifications
You must be signed in to change notification settings - Fork 20
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 Keyboard toggle/icon and make key/mouse focus mutually exclusive #102
Conversation
Ah, I didn't catch that the |
Ahh sorry didn’t realize that was auto generated! this change looks great. Having this choice be sticky in props would be lovely but I can also have sure menus launch different configs. |
A couple UX annoyances I'd like to fix on this branch.
Not totally sure this is the right move, but going to look into filtering the global focus callbacks to only apply those related to the UI's component peer. |
Ok, that was a bit annoying to figure out. Part of the "mutually exclusive" complication was that The keyboard focus setting will now also be remembered. I think I've cleanup up all the edge cases, with #104 as a bonus. There are certainly some unideal things, like I don't feel 100% rock solid about the mouse listener enable/disable RAII situation, but I added a jassert to hopefully catch any issues bubbling up. Going to live with this a bit longer before merging. Feel free to check it out too. |
There's still one issue I'm not sure exists / how to resolve / if I'm just lacking some understanding.
I'm wondering if This should be reproducible:
I think what's happening is that the root plugin UI is stealing focus, maybe incorrectly because of code in the inspector. Where my understanding stalls out: I'd like to have some global keyboard shortcuts in my plugin. Does that mean |
Ignoring
Reverting back to just ignoring |
This PR
According to @baconpaul's comment here and my own futzing about, I'm making the assumption that when keyboard focus is enabled, mouse listening should be disabled. Everything feels too messy otherwise.
Note: Even with the overlay's mouse listening disabled, clicking on elements in JUCE UIs still does set keyboard focus by default, see https://docs.juce.com/master/classComponent.html#a5e27530ab343f52b524c1c3f1a1d98eb — in other words, most of the time focus will still change by clicking around the UI!
Questions:
settings->props
? Or is it fine to always assume it should be off?