<AWT Dev> [14] RFR JDK-8214578: [macos] Problem with backslashes on macOS/JIS keyboard: Java ignores system settings
Sergey Bylokhov
Sergey.Bylokhov at oracle.com
Tue Oct 1 20:05:14 UTC 2019
Hi, Prasanta.
I did not find any documentation for TISGetInputSourceProperty, does it public API?
But I found a list of related crashes in some applications because the TISGetInputSourceProperty may return NULL.
Can you please double check that the previous fixes which touches these lines of code still works:
JDK-8148555, JDK-8132503, JDK-8180370
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) "
> 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/
>
> Regards
> Prasanta
>
--
Best regards, Sergey.
More information about the awt-dev
mailing list