RFR: 8308644: [Linux] Missing mappings for dead keys + Alt Gr [v5]

Martin Fox duke at openjdk.org
Thu Aug 3 19:04:39 UTC 2023


On Thu, 22 Jun 2023 11:45:30 GMT, Thiago Milczarek Sayao <tsayao at openjdk.org> wrote:

>> This PR adds missing key mappings for dead keys and fixes "Alt Gr" for some systems.
>
> Thiago Milczarek Sayao has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 16 additional commits since the last revision:
> 
>  - Minimize changes
>  - Merge branch 'master' into gdk_to_glass_key_map
>  - Forgot test code
>  - Back to hash
>  - Revert key lock change because it has different behaviour
>  - Revert modifier change + Remove F13 -> F24
>  - Remove print statement
>  - Use GDK instead of X calls (to ease in a future wayland implementation)
>  - Avoid sending unknown key event
>  - GDK_META_MASK is not ALT
>  - ... and 6 more: https://git.openjdk.org/jfx/compare/1b8f7d64...aad021a6

I'm surprised no customer ever noticed this. On Linux the current JavaFX behavior is that the real AltGr key (the one that appears on European and UK keyboards) is assigned KeyCode.UNDEFINED. On layouts like US English the right Alt key is just an Alt key but we sill assign it KeyCode.ALT_GRAPH. So, yeah, we should be adding ISO_Level3_Shift to the map.

The Robot digs through the hash map to do a reverse lookup from KeyCode to keysym. I'll add AltGr to my keyboard test app and sort out how this affects the Robot. I'm not too worried about making matters worse, as it stands the Robot can't send an ALT_GRAPH key event on layouts that actually use AltGr.

The dead key additions are harmless and make the system look more professional but those codes only show up on RELEASED KeyEvents so I suspect they will be ignored. Windows doesn't even generate RELEASED events for dead keys. The Mac does but the codes are wrong. But, again, I don't see any downside to adding them.

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

PR Comment: https://git.openjdk.org/jfx/pull/1143#issuecomment-1664483379


More information about the openjfx-dev mailing list