← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #167398]: keyDown(Key.WIN) not working - Java problem

 

Question #167398 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/167398

    Status: Open => Answered

RaiMan proposed the following answer:
This seems to be a Java problem, but until now, I did not find anything
in the net.

Sikuli correctly translates the Key.WIN (u"\ue023") to the Java
KeyEvent.VK_META (which is int 157), but the JRE is giving the above
exception: invalid key code.

I have tested this using the Java classes directly

import java.awt.Robot as jR
import java.awt.KeyEvent as jKE

k = jKE.VK_META

r = jR() # makes a new robot
r.keyPress(k)
r.keyRelease(k)

resulting in the same error.

In my Mac environment this works perfectly (VK_META on Mac stands for
the cmd-key).

Conclusion:
Due to the above Java problem, currently Key.WIN cannot be pressed on Windows. It can only be used as a modifier key
type("r", KEY_WIN)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.