JDK-8278924 : [Linux] Robot hits incorrect keys on non-U.S. keyboard layouts
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: jfx17
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux_ubuntu
  • Submitted: 2021-12-16
  • Updated: 2023-12-22
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.
Other
tbdUnresolved
Related Reports
Relates :  
Description
When the user has multiple layouts installed the Robot can target the wrong keys when generating press and release events. This can also happen if the user has only one layout installed if it's not a U.S. layout; under the hood there is often a second U.S. layout that's not visible to the user. This can cause failures in the manual KeyboardTest application in tests/manual/events.

Alternatively you can run the attached manual test. Install French and English layouts in whatever order and make the second one active. Run the RobotKeySanityTest and press the alphabet keys. Wherever the layouts don't match the test will fail.

Under the hood the Robot code is asking for a list of all hardware keycodes that can generate the given keyval. It then just picks the first on the list without checking the group or shift level.
Comments
Really should add ISO_Level3_Shift to the hash table since this is the keyval used on ISO keyboards. This is also the only keyval that works when trying to hit AltGr using a Robot.
22-12-2023

A pull request was submitted for review. URL: https://git.openjdk.java.net/jfx/pull/718 Date: 2022-01-17 20:25:08 +0000
17-01-2022