<AWT Dev> [10] JDK-8148344: Java robot keypress should be able to use extended key code characters as ? ? ?.
Sergey Bylokhov
Sergey.Bylokhov at oracle.com
Tue Apr 24 05:22:03 UTC 2018
On 23/04/2018 21:28, Shashidhara Veerabhadraiah wrote:
> [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.
You describe two different cases:
- If you generate an event for some char like 'å' in the current
locale and can obtain which keyCode is assigned to this char, then it is
the same as generate event for this keyCode. In this case the changes in
classes other than Robot are not necessary.
- If you generate an event for some char like 'å' in some other(not
currently used locale) and cannot obtain which keyCode is assigned to
this char, then it is the same as generate "type" event for Chinese
char. In this case the changes in classes other than Robot are not
necessary, because it should work in the current java apps(On macOS this
character "å" may be generated by "alt+a" in US locale).
More information about the awt-dev
mailing list