sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #42230
[Question #623032]: How to type command+w etc. to use MAC shortcut keys.
New question #623032 on Sikuli:
https://answers.launchpad.net/sikuli/+question/623032
hi, i met some problem in using Key Class.
environment:
os: mac osx 10.12 / jdk:1.7 /sikuli 1.1.0 /Java
When i using my app, i'm trying to using COMMAND+W/ COMMAND+Q etc. to switch function. But they does't work.
-----------------
screen.type(Key.F12); //that work well.
but:
screen.type(KeyModifier.CMD+"W"); //it didn't work..
democode:
public static void main(String[] args) throws Exception{
//activity my app such as safari/wechat/system settings etc.
Time.sleep(10);
screen.type(Key.F12); //work well.
screen.type(KeyModifier.CMD+"W"); //didn't work
System.out.println("CMD:"+Key.getTextFromKeycode(KeyModifier.CMD)); //LOG as CMD:null
}
so.
if i want to use key: command, command+w, command+Q, how?
i used "KeyModifier.WIN" ,still didn't work.
If you can help, that would be wonderful.thx a lot.
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.