sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #47789
[Question #670988]: Trouble passing string into type()
New question #670988 on Sikuli:
https://answers.launchpad.net/sikuli/+question/670988
Hello Sikuli World,
Thanks for your generous help!
I have an app that uses 'hotkeys' (aka keyboard shortcuts) to perform various functions. In the sikuli IDE I can put the following in and it will open and close a panel on the app as expected.
type('P', Key.CTRL + Key.SHIFT)
When I try creating a string and using it as below it does not work. I have tried escaping the single quotes and that also did not work.
x = "'P', Key.CTRL + Key.SHIFT"
type(x)
My versions are:
sikuli 1.1.2
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) Client VM (build 25.161-b12, mixed mode, sharing)
I also get this but not always:
Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
at java.awt.Component.getLocationOnScreen_NoTreeLock(Unknown Source)
at java.awt.Component.getLocationOnScreen(Unknown Source)
at javax.swing.text.JTextComponent$InputMethodRequestsHandler.getTextLocation(Unknown Source)
at sun.awt.im.InputMethodContext.getTextLocation(Unknown Source)
at sun.awt.windows.WInputMethod$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.