anthonyalfimov / Stable-Delay

AU, VST3. A WIP delay/chorus/flanger plugin
GNU General Public License v3.0
3 stars 1 forks source link

Dropdown object does not interact correctly with keyboard focus #59

Closed anthonyalfimov closed 3 years ago

anthonyalfimov commented 3 years ago
DAW Bug
All +

A JUCE ComboBox object grabs keyboard focus after you click on it, so you can use arrow keys to step through options. Our Dropdown class object grabs keyboard focus when you click on it, but loses it once the popup is dismissed. Keyboard control of the Dropdown only works while the popup is active (and is not reflected in the popup) - instead of controlling the popup.

Clicking on the CentrePanel object unexpectedly gives keyboard focus to the Dropdown object (that is its grandchild). Clicking the parent of a ComboBox object does not give it keyboard focus.

A Dropdown object should behave the same way as a ComboBox object and not lose keyboard focus after popup dismissal. Clicking on its parent / grandparent shouldn't grant it keyboard focus. When the popup is active, it should take the keyboard focus and use it to highlight its options.

~When popup is not active, It could be even better to give the Dropdown keyboard focus only when the mouse is hovering over it (gains it on mouseEnter, loses it on mouseExit).~

anthonyalfimov commented 3 years ago

Giving keyboard focus to Dropdown only when mouse hovers over it: if this is the case, then what is the point of using the keyboard? This makes sense for using mouse wheel, but it is already the default behaviour of JUCE ComboBox.

Keyboard control only makes sense if it is independent from the mouse to a sufficient degree.