<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>The behavior on Windows is all over the place for different
      applications.  I tested a few I've got running:<br>
    </p>
    <p>Notepad, Notepad++, Eclipse:</p>
    <p>- Alt-down: Shows mnemonics on menu bar<br>
      - Alt-up: Highlights file menu on alt release<br>
      - 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</p>
    <p>-> Looks buggy<br>
    </p>
    <p>Thunderbird / Opera / Firefox:</p>
    <p>- Alt-down: nothing<br>
      - Alt-up: shows menu bar (it is hidden normally)<br>
      - Alt-tab: works as expected, no highlighting</p>
    <p>-> Looks well behaved</p>
    <p>Explorer / Excel / Wordpad:</p>
    <p>- Alt-down: nothing<br>
      - Alt-up: shows mnemonics<br>
      - Alt-tab: works as expected, no highlighting</p>
    <p>-> Looks well behaved</p>
    <p>Visual Studio Code:</p>
    <p>- Alt-down: Shows mnemonics on menu bar<br>
      - Alt-up: Highlights file menu on alt release<br>
      - Alt-tab: Shows mnemonics, but hides them once it loses focus; on
      return doesn't show mnemonics</p>
    <p>-> Looks well behaved</p>
    <p>Chrome / IntelliJ:</p>
    <p>-> Looks well behaved, doesn't react to alt presses in any way</p>
    <p>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).<br>
    </p>
    <p>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).</p>
    <p>There seems to be two correct ways of handling mnemonics in
      applications that use them, either:</p>
    <p>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)</p>
    <p>b) only show mnemonics on a naked alt-up<br>
    </p>
    <p>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.</p>
    <p>--John<br>
    </p>
    <div class="moz-cite-prefix">On 10/02/2023 14:29, Pedro Duque Vieira
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAAEud6YkaSsVfOfGEDJq_0yJvnqA7-wuNNcGipKaQD1fwfWqzg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi,
        <div><br>
        </div>
        <div>I'm developing an application for a customer and it seems
          like we've been hit by: <a class="gmail-issue-link"
            href="https://bugs.openjdk.org/browse/JDK-8090647"
            id="gmail-key-val" rel="4819271"
            style="font-family:"DejaVu
            Sans",sans-serif;font-size:14px;color:rgb(0,82,204)"
            moz-do-not-send="true">JDK-8090647</a> (?)<br>
          <br>
          Steps:<br>
          <div>
            <p style="margin:0px;padding:0px;line-height:1.714">1 -
              press alt + tab to switch to another app<br>
              2 - press alt + tab again to switch to javafx app again<br>
              3 - type a key with an associated "mnemonic action" in the
              javafx app (no alt key being pressed)</p>
            <p style="margin:0px;padding:0px;line-height:1.714">4 -
              "mnemonic action" gets triggered even though it shouldn't<br>
              <br>
              So the problem is that the alt seems to "stick" after the
              javafx app loses and regains focus (through alt <a
                class="gmail_plusreply" id="plusReplyChip-0"
                moz-do-not-send="true">+</a> tab) .</p>
            <p style="margin:0px;padding:0px;line-height:1.714"><br>
            </p>
            <p style="margin:0px;padding:0px;line-height:1.714">I've
              tested this under Windows 10 and Windows 11.<br>
              <br>
              This is problematic to us since our users often use the
              keyboard to interact with our app and the previous version
              of our app (built in a different language than Java)
              didn't have this problem.<br>
              <br>
              <span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;letter-spacing:normal;white-space:pre-wrap;background-color:rgb(255,255,255)">--</span><br>
            </p>
          </div>
          <div dir="ltr" class="gmail_signature"
            data-smartmail="gmail_signature">
            <div dir="ltr">
              <div>Pedro Duque Vieira - <a
                  href="https://www.pixelduke.com" target="_blank"
                  moz-do-not-send="true" class="moz-txt-link-freetext">https://www.pixelduke.com</a></div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
  </body>
</html>