Alt key sticks even after app loses focus (JDK-8090647)
Pedro Duque Vieira
pedro.duquevieira at gmail.com
Sun Feb 12 14:52:52 UTC 2023
>
> The behavior on Windows is all over the place for different
> applications.? I tested a few I've got running:
Notepad, Notepad++, Eclipse:
- Alt-down: Shows mnemonics on menu bar
> - Alt-up: Highlights file menu on alt release
> - Alt-tab: Shows mnemonics but doesn't highlight menu when it loses
> focus; when returning, mnemonics still highlighted, but doesn't act on
> them as menu not selected
-> Looks buggy
Thunderbird / Opera / Firefox:
- Alt-down: nothing
> - Alt-up: shows menu bar (it is hidden normally)
> - Alt-tab: works as expected, no highlighting
-> Looks well behaved
Explorer / Excel / Wordpad:
- Alt-down: nothing
> - Alt-up: shows mnemonics
> - Alt-tab: works as expected, no highlighting
-> Looks well behaved
Visual Studio Code:
- Alt-down: Shows mnemonics on menu bar
> - Alt-up: Highlights file menu on alt release
> - Alt-tab: Shows mnemonics, but hides them once it loses focus; on
> return doesn't show mnemonics
-> Looks well behaved
Chrome / IntelliJ:
-> Looks well behaved, doesn't react to alt presses in any way
None of the applications tested reacted on a mnemonic key after
> regaining focus however, even though they may have them still
> highlighted (which I think is a bug).
In my opinion, the behavior of notepad/notepad++/eclipse is incorrect
> (they need to hide the mnemonics on focus lost, like Visual Studio Code
> does, but they don't).
There seems to be two correct ways of handling mnemonics in applications
> that use them, either:
a) shows mnemonics immediately on alt-down, but hide them on focus lost
> (if the alt-down becomes an alt-tab, or probably any other alt combination)
b) only show mnemonics on a naked alt-up
Ticket JDK-8090647 mentions a spec that has been updated, but I can't
> find it.? It also mentions that the behavior for JavaFX should be what I
> described in a), so I think this is a bug that can simply be fixed.
--John
Yap, there's quite different behaviors across apps. If you test on windows
11 you'll get yet another set of different behaviors.
But all in all, if you: alt+tab (without release) and alt+tab again so your
app regains focus, you'll have the mnemonic still activated, which, as you
say, sounds like a bug no matter the difference in behaviors across apps.
I agree with your suggestion: "a".
My client was quite disappointed and started to rant about javafx. It
didn't help that we were hit by a couple other bugs (perhaps bad
luck). The fact that the bug was filed on 2013 (10 years later) and is
still happening can be quite problematic.
Perhaps it would make sense to review all bugs filed, giving highest
priority to the bugs that were submitted longer ago?
Thanks!
--
Pedro Duque Vieira - https://www.pixelduke.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20230212/cf83805c/attachment.htm>
More information about the openjfx-dev
mailing list