开发者

Can we insert Unicode Characters using Robot Class in Java?

开发者 https://www.devze.com 2023-04-01 06:16 出处:网络
I am developing a Real time English-Sinhala Unicode transl开发者_运维知识库ator in java.I did the translation part.But now I want to add the Final output Unicode characters to the currently active win

I am developing a Real time English-Sinhala Unicode transl开发者_运维知识库ator in java.I did the translation part.But now I want to add the Final output Unicode characters to the currently active window (like a web browser).There's a way to add characters via java Robot class with Robot.keyPress(//keyInput) method.But is there any way to do this with java Unicode characters like u0200 hex value.If it can't be done with this way what solutions I have to resolve this.Please anyone help me ?


Yes, you can simulate key presses using Robot, as suggested here. No, Robot can't see what's printed on the user's key caps. You're probably going to have to develop a virtual keyboard. When available, Unicode glyphs make usable button labels, as shown here.

Addendum: Note that a KeyEvent represents a keystroke, while Unicode encodes graphemes represented by glyphs. The mapping depends on the keyboard layout, e.g. Sinhala.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号