<AWT Dev> [14] RFR JDK-8214578: [macos] Problem with backslashes on macOS/JIS keyboard: Java ignores system settings

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Wed Sep 25 11:18:12 UTC 2019

Hi All,

Please review a fix for an issue where it is seen that Java apps ignore 
system settings regarding handling yen key.

If we use mac keyboard layout to use Japanese input source and "Change 
Settings -> Keyboard -> Input Sources -> Japanese -> "Â¥" key generates 
-> \ (Backslash) "
and Change Input method to Romaji and press "yen" symbol in Japanese 
keyboard or "option+y" key combination in US keyboard
Java app still interprets it as "yen" in JTextField

Issue seems to happen due to fact when NSTextInputClient.insertText() 
method is called, even though  "\" codePoint is passed,

but insertText() has a check for codePoint is complex or not, so in this 
case, it is not complex, InputMethodEvent is not generated and no "\" is 
inserted in JTextField.

Proposed fix is to see if keyboard layout is Japanese (kotoeri) and 
codePoint is "\" then take it as complex codepoint and generate IME,

so that whatever system setting is set for "yen" symbol, it is correctly 
interpreted and inputted in CInputMethod.insertText() method, to be seen 
in JTextField.

The fix has been tested in US keyboard and Japanese keyboard.

Bug: https://bugs.openjdk.java.net/browse/JDK-8214578

webrev: http://cr.openjdk.java.net/~psadhukhan/8214578/webrev.0/


More information about the awt-dev mailing list