JDK-8262945 : [macos] Regression Manual Test for Key Events Fails
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8,11.0.10-oracle,15,16,17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2021-03-03
  • Updated: 2023-11-29
  • Resolved: 2021-11-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 18
18 b22Fixed
Related Reports
Relates :  
Relates :  
Description
Testsuite Name : Regression manual
Test Name(s)   : java/awt/event/KeyEvent/AcceleratorTest/AcceleratorTest.html

Product Tested : JDK11.0.11+5
Platform Tested : MAC OSX 10.14
Is it regression : No
Reproducible: Always

JDK11.0.11+4 on MAC OSX 10.14 : Failed
JDK11.0.10+8 (GAC) on MAC OSX 10.14 : Failed
JDK17+9 on MAC OSX 10.14 : Failed
JDK8u291b05 on MAC OSX 10.14.3 : Failed 

Is it Platform specific : No , Passed on Windows10 with JDK11.0.11+5  

Exception/Error from Log: N/A

Steps to reproduce: Run the Test , As per instructions 
" Ensure you have Russian keyboard layout as a currently active.",
            "(1) Press Ctrl+\u0411 (a key with ",<" on it) ",
            "(2) Find a . (period) in this layout (perhaps "/?" or "7&" key).",
            "Press Ctrl+.",
            "(3) Press Crtl+ regular English . (period) key (on ".>" )",
            "(4) Press Ctrl+ key with English N.",
            "(5) Press Alt+\u042E (key with ".>")",
            "(6) Press Alt+\u0436 (key with ";:")",
            "If all expected commands will be fired, look for message",
            "\"All tests passed\""

Actual behavior: User pressed these keys on the key board but all expected commands are not fired 
Comments
Changeset: 47e7a425 Author: Alisen Chung <alisen.chung@oracle.com> Committer: Alexander Zuev <kizune@openjdk.org> Date: 2021-11-01 22:29:40 +0000 URL: https://git.openjdk.java.net/jdk/commit/47e7a42594f1c36f71cdf4d383080bf8d616b7e7
01-11-2021

Seems like the bug is caused by Java expecting a different keycode for characters in different languages, but macos ignoring active keyboard layout for keycodes. For example, 'б' keycode=16778289, but when pressed, a keyEvent with keycode=44 is generated. The equivalent key in English layout is ',' which has keycode=44, and when pressed also generates a keyEvent with keycode=44.
20-09-2021