← Back to team overview

sikuli-driver team mailing list archive

[Bug 1299462] [NEW] [request] want to be able to type() any unicode character

 

Public bug reported:

****** base for a solution on Windows, Mac and most Linux
this post summarises the keyboard actions needed to enter a unicode character based on its hex code:
http://superuser.com/questions/13086/how-do-you-type-unicode-characters-using-hexadecimal-codes

this all can be simulated with a Java AWT Robot keyboard action
--------------------------------------------------------------------------

Today I found that UTF-8 characters aren't supported by type(). I got
following error in my java tests:

Exception in thread "main" java.lang.IllegalArgumentException: Cannot convert character Д
 at org.sikuli.script.Key.toJavaKeyCode(Key.java:319)
 at org.sikuli.script.RobotDesktop.typeChar(RobotDesktop.java:234)
 at org.sikuli.script.Region.keyin(Region.java:2748)
 at org.sikuli.script.Region.type(Region.java:2613)
 at kz.vas.emulator.whatsapp.WhatsAppSender.main(WhatsAppSender.java:22)

I found many questions on the portal concerning this situation and
understand that for type() I must use ASCII or use paste() to past UTF-8
symbols. However, I'm testing android app on the emulator and there is
no option to use past(), and type() is the only option to input text (as
I may suppose).

So, my question is: is there any opportunities to input text using
sikuli to android apps? Perhaps, you know additional resources which I
can include to my project?

** Affects: sikuli
     Importance: High
     Assignee: RaiMan (raimund-hocke)
         Status: In Progress

** Changed in: sikuli
       Status: New => In Progress

** Changed in: sikuli
   Importance: Undecided => High

** Changed in: sikuli
     Assignee: (unassigned) => RaiMan (raimund-hocke)

** Changed in: sikuli
    Milestone: None => 1.2.0

** Description changed:

  ****** base for a solution on Windows, Mac and most Linux
  this post summarises the keyboard actions needed to enter a unicode character based on its hex code:
  http://superuser.com/questions/13086/how-do-you-type-unicode-characters-using-hexadecimal-codes
  
+ this all can be simulated with a Java AWT Robot keyboard action
  ----------------------------------------------------------------------------------------------
  Today I found that UTF-8 characters aren't supported by type(). I got following error in my java tests:
  
  Exception in thread "main" java.lang.IllegalArgumentException: Cannot convert character Д
- 	at org.sikuli.script.Key.toJavaKeyCode(Key.java:319)
- 	at org.sikuli.script.RobotDesktop.typeChar(RobotDesktop.java:234)
- 	at org.sikuli.script.Region.keyin(Region.java:2748)
- 	at org.sikuli.script.Region.type(Region.java:2613)
- 	at kz.vas.emulator.whatsapp.WhatsAppSender.main(WhatsAppSender.java:22)
+  at org.sikuli.script.Key.toJavaKeyCode(Key.java:319)
+  at org.sikuli.script.RobotDesktop.typeChar(RobotDesktop.java:234)
+  at org.sikuli.script.Region.keyin(Region.java:2748)
+  at org.sikuli.script.Region.type(Region.java:2613)
+  at kz.vas.emulator.whatsapp.WhatsAppSender.main(WhatsAppSender.java:22)
  
  I found many questions on the portal concerning this situation and
  understand that for type() I must use ASCII or use paste() to past UTF-8
  symbols. However, I'm testing android app on the emulator and there is
  no option to use past(), and type() is the only option to input text (as
  I may suppose).
  
  So, my question is: is there any opportunities to input text using
  sikuli to android apps? Perhaps, you know additional resources which I
  can include to my project?
  
  RaiMan, guys, could you please advise me whether you have any
  instruction about source codes? Due to the fact that there are many
  packages I'm a bit confused, and couldn't find source codes of API for
  java (I mean source codes for sikuli-java.jar). I'd like to browse the
  code, perhaps I could fix the UTF problem.
  
  Thank you!

** Description changed:

  ****** base for a solution on Windows, Mac and most Linux
  this post summarises the keyboard actions needed to enter a unicode character based on its hex code:
  http://superuser.com/questions/13086/how-do-you-type-unicode-characters-using-hexadecimal-codes
  
  this all can be simulated with a Java AWT Robot keyboard action
- ----------------------------------------------------------------------------------------------
- Today I found that UTF-8 characters aren't supported by type(). I got following error in my java tests:
+ --------------------------------------------------------------------------
+ 
+ Today I found that UTF-8 characters aren't supported by type(). I got
+ following error in my java tests:
  
  Exception in thread "main" java.lang.IllegalArgumentException: Cannot convert character Д
   at org.sikuli.script.Key.toJavaKeyCode(Key.java:319)
   at org.sikuli.script.RobotDesktop.typeChar(RobotDesktop.java:234)
   at org.sikuli.script.Region.keyin(Region.java:2748)
   at org.sikuli.script.Region.type(Region.java:2613)
   at kz.vas.emulator.whatsapp.WhatsAppSender.main(WhatsAppSender.java:22)
  
  I found many questions on the portal concerning this situation and
  understand that for type() I must use ASCII or use paste() to past UTF-8
  symbols. However, I'm testing android app on the emulator and there is
  no option to use past(), and type() is the only option to input text (as
  I may suppose).
  
  So, my question is: is there any opportunities to input text using
  sikuli to android apps? Perhaps, you know additional resources which I
  can include to my project?
- 
- RaiMan, guys, could you please advise me whether you have any
- instruction about source codes? Due to the fact that there are many
- packages I'm a bit confused, and couldn't find source codes of API for
- java (I mean source codes for sikuli-java.jar). I'd like to browse the
- code, perhaps I could fix the UTF problem.
- 
- Thank you!

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1299462

Title:
  [request] want to be able to type() any unicode character

Status in Sikuli:
  In Progress

Bug description:
  ****** base for a solution on Windows, Mac and most Linux
  this post summarises the keyboard actions needed to enter a unicode character based on its hex code:
  http://superuser.com/questions/13086/how-do-you-type-unicode-characters-using-hexadecimal-codes

  this all can be simulated with a Java AWT Robot keyboard action
  --------------------------------------------------------------------------

  Today I found that UTF-8 characters aren't supported by type(). I got
  following error in my java tests:

  Exception in thread "main" java.lang.IllegalArgumentException: Cannot convert character Д
   at org.sikuli.script.Key.toJavaKeyCode(Key.java:319)
   at org.sikuli.script.RobotDesktop.typeChar(RobotDesktop.java:234)
   at org.sikuli.script.Region.keyin(Region.java:2748)
   at org.sikuli.script.Region.type(Region.java:2613)
   at kz.vas.emulator.whatsapp.WhatsAppSender.main(WhatsAppSender.java:22)

  I found many questions on the portal concerning this situation and
  understand that for type() I must use ASCII or use paste() to past
  UTF-8 symbols. However, I'm testing android app on the emulator and
  there is no option to use past(), and type() is the only option to
  input text (as I may suppose).

  So, my question is: is there any opportunities to input text using
  sikuli to android apps? Perhaps, you know additional resources which I
  can include to my project?

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1299462/+subscriptions


Follow ups

References