On Thu, 14 Aug 2025 23:38:02 GMT, Anass Baya <[email protected]> wrote:

> **Analysis :**
> When the problem occurrs, the key press event related to the mnemonic 
> triggers 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;
>         }
> ...

This pull request has now been integrated.

Changeset: 07ea907e
Author:    Anass Baya <[email protected]>
Committer: Alexey Ivanov <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/07ea907e4fc8aa8fda01d8fe64c599f9d944eef9
Stats:     5 lines in 3 files changed: 1 ins; 1 del; 3 mod

8361606: ConsumeNextMnemonicKeyTypedTest.java fails on Windows: character typed 
with VK_A: a
8321303: Intermittent 
open/test/jdk/java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeNextMnemonicKeyTypedTest.java
 failure on Linux

Reviewed-by: dnguyen, honkar, aivanov

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

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

Reply via email to