<AWT Dev>  JDK-8148344: Java robot keypress should be able to use extended key code characters as ? ? ?.
shashidhara.veerabhadraiah at oracle.com
Tue Apr 24 04:28:02 UTC 2018
Hi Sergey, Thanks for your time in reviewing this. Below are my answers:
Thanks and regards,
From: Sergey Bylokhov
Sent: Tuesday, April 24, 2018 5:30 AM
To: Shashidhara Veerabhadraiah <shashidhara.veerabhadraiah at oracle.com>; awt-dev at openjdk.java.net
Subject: Re: <AWT Dev>  JDK-8148344: Java robot keypress should be able to use extended key code characters as ? ? ?.
On 18/04/2018 23:52, Shashidhara Veerabhadraiah wrote:
> Hi Sergey, I checked with Prashanth on the external input method. It is just same as change the locale and start input the characters in that locale. Once we change the locale it will try to install sogu or other stuffs to get those locale keys. But on the windows 10 it does not install anything but keyboard language is changed and we can start input those characters. So when I checked with input of different locale keys and found that most of them do generate the keyTyped/keyPressed/keyReleased events for the java component which is same as my implementation under this bug. Only for the Chinese input we only get the keyTyped event. I think since we provide the superset I think this problem is solved. So I think my current changes are fine so please let me know if you have any comments on it.
I assume that you checked the steps above without the changes in files(AWTView.m/awt_Component.cpp/ etc). So external InputMethods(including Chinese input) works in java applications as-is.
And it should work for windows/linux/macos. Why we need to change these files (AWTView.m/awt_Component.cpp/etc) instead of generate the same events, as input methods, using Robot API?
[Shashi] Yes it was checked without my changes in. Robot key events is a different method of input compared to the external input method. Robot Unicode key input api uses the Unicode code point as input and our keyboard language remains same. So for ex., keyboard language is set to US and if we want to input Russian language(Cyrillic U+0400 onwards) into a component, we can use the newly formed Unicode input api. Otherwise in the case of external input method, we would need to change the keyboard language to Russian and then input only Russian keys using the physical keys and switch back to US keyboard style to input the US symbols. The later way is not required to be done by the current robot Unicode implementation. Hence with this implementation the user can simply say as "keyUnicode(1024)"(U+0400) without changing the keyboard language.
Best regards, Sergey.
More information about the awt-dev