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

Philip Race philip.race at oracle.com
Wed Sep 25 15:57:53 UTC 2019


Can you please add your evaluation to the bug. Last comment from you in 
there is
"it's still not reproducible for me" which seems unlikely if you have a 
proposed fix.

Actually I am having some trouble understanding what you wrote below.
Questions in line.

On 9/25/19, 4:18 AM, Prasanta Sadhukhan wrote:
> 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) "

"Japanese -> "Â¥" key generates"

What are you trying to say here with that -> ? Is that another level of 
setting or do
you mean after setting to Japanese and typing some key still generates 
backslash ?
Why does it say ¥" ? That isn't a key, is it ?

> 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

Umm  .. "still interprets it as Yen" ? Isn't that what you wanted to 
happen ?

> 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.

I am not sure I can parse this correctly

"fact when" ? is where I start to get lost.
Can you restate it ?

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

Why ? Is backslash special ?

> 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/
> Regards
> Prasanta

More information about the awt-dev mailing list