[Java] type() text from java with azerty-keyboard

Bug #639657 reported by Berty
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
In Progress
Low
RaiMan

Bug Description

i try to run this program from java:

 public static String collect(String ip) throws FindFailed {
  Screen s = new Screen();
  Win32Util os = new Win32Util();

  System.out.println("ready starting first");
  s.type(null, "10;0;0;196",1);
  System.out.println("ready starting next");

the output of this is:
ready starting first
[sikuli] type "10;0;0;196", mod: Shift(1)
Exception in thread "AWT-EventQueue-0" java.lang.IllegalThreadStateException: Cannot call method from the event dispatcher thread
        at java.awt.Robot.checkNotDispatchThread(Robot.java:465)
        at java.awt.Robot.waitForIdle(Robot.java:444)
        at edu.mit.csail.uid.Region.type(Region.java:379)
        at main.SikuliScript.collect(SikuliScript.java:22)
        at main.Main.updateAccessPoints(Main.java:269)
        at main.Main$1.mouseClicked(Main.java:152)
        at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
        at java.awt.Component.processMouseEvent(Component.java:6266)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
        at java.awt.Component.processEvent(Component.java:6028)
        at java.awt.Container.processEvent(Container.java:2041)
        at java.awt.Component.dispatchEventImpl(Component.java:4630)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
        at java.awt.Container.dispatchEventImpl(Container.java:2085)
        at java.awt.Window.dispatchEventImpl(Window.java:2478)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

what am i doing wrong or is this a bug?

version of sikuli: 0.10.2
os: windows 7 32bit
attention: my os has azerty settings, that why i need to enter the ip to get it correctly
the ip gets typed correctly but crashes right after that

Tags: fkt-type
Revision history for this message
Berty (verhelst-bert) wrote :

found a workaround

the action gets executed, the exception is trown afterwards
so this works:

try{
 s.type(null, "c", 2);
}catch(Exception ex){}

RaiMan (raimund-hocke)
summary: - type text from java, IllegalThreadStateException
+ [Java] type() text from java with azerty-keyboard
RaiMan (raimund-hocke)
Changed in sikuli:
status: New → In Progress
importance: Undecided → Low
assignee: nobody → RaiMan (raimund-hocke)
tags: added: fkt-type
removed: illegalthreadstateexception java
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.