RFR: 8183521: Unable to type characters with tilde with swiss german keyboard layout [v2]

Martin Fox mfox at openjdk.org
Tue Oct 1 22:30:41 UTC 2024


On Tue, 1 Oct 2024 20:17:52 GMT, Martin Fox <mfox at openjdk.org> wrote:

>> The glass code on Windows does its own dead key processing so at certain points it must clear the dead key state that the OS is maintaining. It does this by simulating a SPACE key press but this only works reliably if the SPACE key is pressed without any modifiers.
>> 
>> Currently the code is picking up the current modifier state of the keyboard. If the dead key is invoked using AltGr the code is trying to clear the dead key state using AltGr+Space. This does nothing. The fix is to ignore the current keyboard state and pretend the only key being held down is Space.
>> 
>> I haven't figured out a way of providing automated tests for dead keys. There's no way to detect whether the correct keyboard layout is active or to force the correct layout to be active.
>> 
>> To test this you'll need to install the correct layout. On Windows 11 go to Settings > Time & language > Language & region. Click on the three dots to the far right of the English entry (or whatever language you're using) and select “Language options”. Scroll down until you find “Add a keyboard”. From that button scroll through all the many, many layouts until you find “Swiss German”. Once you’ve added the keyboard you should see a button on the far right of the task bar to select the layout. The dead key for this bug is where the =/+ key is on the standard US keyboard, top row to the left of Backspace.
>
> Martin Fox has updated the pull request incrementally with one additional commit since the last revision:
> 
>   No point in the kbState being static here

With the Swiss German layout are three dead keys on that key (on a US layout it's the =/+ key just to the left of backspace).
- Without modifiers it's a circumflex
- With Shift it's a grave accent
- With AltGr it's a tilde
It's the AltGr case that was failing.
For testers who aren't familiar with European layouts AltGr is the Alt key to the right of the spacebar. Or so I've been told. I work on a Mac so it was easiest to program a macro key to be AltGr.

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

PR Comment: https://git.openjdk.org/jfx/pull/1585#issuecomment-2387195617


More information about the openjfx-dev mailing list