sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #25060
Re: [Question #246217]: UTF-8 & type(), any other ways?
Question #246217 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/246217
Status: Open => Answered
RaiMan proposed the following answer:
The Java AWT Robot function used down the road for Sikuli's type() on
the Java level is restricted to the use of Java defined key constants,
that are mapped to the standard layout of the US-EN qwerty keyboard.
So the usage of the type() generally is restricted to whatever you can produce with your keyboard (which in fact includes some on-ascii characters on many non-EN keyboards). The current version of Sikuli up to 1.0.1 is restricted, to a subset of what Java finally "presses" on your keyboard, taking the given character as the one from the US-layout.
Some restrictions can be overcome, if you know, which US-EN-key to press, to produce a wanted character with your local keyboard layout.
With version 1.1.0 there will be a tool, that helps to generate a
translation table for your used keyboard and after activation you can
use the characters as they are defined for your keyboard and they will
be typed as such.
But what is really missing is an approach, to generate "any" utf-8 character with the keyboard interface of Java AWT Robot.
... but currently, I have no idea how to do that and what tool/library to use for that.
... and this of course is a different solution on the different systems Windows/Mac/Unix --- grrrrr ... I hate it ;-)
On Windows, I know, there is a trick with the num keys and the alt/alt-gr key to produce non-ascii characters:
press and hold alt and press the 3-digit decimal representation of the character code on the num pad.
If this is a solution for you: you can do that with type - you only need a translation function.
The actual coding of Sikuli is on github (https://github.com/RaiMan/SikuliX-2014).
The key translation is done in the class Key.
The interface to Java AWT Robot is in class DesktopRobot.
If you find A-N-Y solution or have any idea how to get nearer: your
contribution is highly appreciated.
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.