RFR: 8273743: KeyCharacterCombination for "+" does not work on US QWERTY keyboard layout [v3]

Pankaj Bansal pbansal at openjdk.java.net
Sun Dec 5 08:23:21 UTC 2021


On Wed, 10 Nov 2021 18:48:04 GMT, Martin Fox <duke at openjdk.java.net> wrote:

>> There was a mismatch between the way `get_glass_key` generated the Java key code for a given key press and how `getKeyCodeForChar` determined the key code for the matching character. For example, when pressing the plus sign on a US keyboard `get_glass_key` correctly generated `KeyCode.EQUALS` but `getKeyCodeForChar("+")` generated `KeyCode.PLUS`.
>> 
>> In this PR `getKeyCodeForChar` mirrors the behavior of `get_glass_key`; it determines which key the character lies on and generates a key code based on the unshifted character on  the same key.
>> 
>> I'm working on a more comprehensive test case that allows you to press any key on the keyboard and test whether a KeyCharacterCombination for that character will succeed or not. I've attached it to this thread. It might be worth submitting as a manual test case
>> [CharComboTest.txt](https://github.com/openjdk/jfx/files/7247265/CharComboTest.txt)
>> .
>
> Martin Fox has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove extraneous whitespace

The changes look fine. I ran the full system test and I do not see any regression being introduced because of this change. The manual test attached fails for all keys before the change. With the change, the test passes for most of the keys, but fails for following 3 keys 

* Failed: key code Comma did not match Shift+<
* Failed: key code Comma did not match Shift+<
* Failed: key code Comma did not match Shift+<
* Failed: key code Comma did not match Shift+<
* Failed: key code 0 did not match Shift+)
* Failed: key code 0 did not match Shift+)
* Failed: key code 0 did not match Shift+)
* Failed: key code 9 did not match Shift+(
* Failed: key code 9 did not match Shift+(
* Failed: key code 9 did not match Shift+(

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

PR: https://git.openjdk.java.net/jfx/pull/635


More information about the openjfx-dev mailing list