← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #143874]: keyDown(Key.SHIFT) not working on Win with Num-Lock on -- switch it off ; -)

 

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

Description changed to:
**** it is a Java bug, but there is a workaround

Unfortunately, this is a bug of Java robot and we may not be able to fix
it.
(http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=cfc56061b7ccaa1709a312de159d4?bug_id=4908075)

A workaround is to turn off the num lock.
There will be a new API Env.isLockOn() in RC2 to get the state of locking keys. So one can use Env.isLockOn(Key.NUM_LOCK) to know the state of the num lock, and then use type(Key.NUM_LOCK) to turn it off if needed.

---------------------------------------------------------------------

I have this same script for Mac and Windows. On Mac, it works as
expected, but it looks like the shift key isn't pressed on Windows.

Have notepad open with text "asdf" and run the code below:
keyDown(Key.SHIFT)
type(Key.LEFT)
type(Key.LEFT)
type(Key.LEFT)
keyUp(Key.SHIFT)

It should highlight "sdf", but on Windows, it only moves the cursor
between "a" and "s" as if it only moved left 3 times without shift key
down.

Is this a bug? Any work around?

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