简体   繁体   中英

Sikuli @ Sign with java

I have a string for my email-address:

 String email = "dummy@web.de";

Now I want to type this email-address to a certain field on a web page. So I do this

 s.type("login.png", email);

but if I execute the application this will be typed

dummy"web.de

I have a german keyboard layout and on german keyboards the @-symbol is located on ALTGR + q . So I modified the application like this

s.click("login.png");
s.type("dummy");
s.keyDown(KeyModifier.ALTGR);
s.type("q");
s.keyUp(KeyModifier.ALTGR);

and the result is "dummy q" (with a space)

I also tried this

s.type("q", KeyModifier.ALTGR);

but this will result in "dummyq" (without a space)

In case somebody needs this information, I use the following imports:

import org.sikuli.script.*;
import org.sikuli.basics.Debug;

and I use sikulixapi-1.1.0.jar

Thanks for your help Hauke

Found the solution by myself. In order somebody has the same issue

s.type("q", KeyModifier.ALT | KeyModifier.CTRL);

this fixed the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM