RFR: 8361606 : ConsumeNextMnemonicKeyTypedTest.java fails on Windows: character typed with VK_A: a

Anass Baya abaya at openjdk.org
Fri Aug 15 00:53:46 UTC 2025


**Analysis :**
When the problem occurred, the key press event related to the mnemonic triggered the item selection. However, as we returned to the menu, the subsequent key typed event arrived and was treated as a normal key press instead of being recognized as part of the mnemonic sequence.

**Proposed Fix:**
As a fix, we are tagging the next key typed event to be consumed by the Keyboard Focus Manager


    public void processKeyEvent(Component focusedComponent, KeyEvent e) {
        // consume processed event if needed
        if (consumeProcessedKeyEvent(e)) { <--- consumed here
            return;
        }
...

-------------

Commit messages:
 - Track the next KEY_TYPED related to the mnemonic key press event so it will be consumed but the keyboard focus manager

Changes: https://git.openjdk.org/jdk/pull/26790/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26790&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8361606
  Stats: 2 lines in 2 files changed: 1 ins; 1 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/26790.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26790/head:pull/26790

PR: https://git.openjdk.org/jdk/pull/26790


More information about the client-libs-dev mailing list