Comment 0 for bug 985395

Revision history for this message
Jayanti Srivastava (jayantsrivas) wrote : unexpected behavior of env.isLockOn()

Hi,
I am using sikuli X-1.0rc3, windows xp 32 bit

and trying to get the current state of CAPS LOCK key - using isLockOn().
But surprisingly it does not seem to work - at least as I expected.

It works correctly for the first time - but the second call returns whatever was returned by it for the first time.

For example, if caps lock is on, then first isLockOn() returns True, but thereafter if the capslock state changes to off, then still isLockOn() returns True.

for this I used the following code, in sikuli ide

print str(Env.isLockOn(Key.CAPS_LOCK))
keyDown(Key.CAPS_LOCK)
keyUp(Key.CAPS_LOCK)
print str(Env.isLockOn(Key.CAPS_LOCK))

kindly let me know if we are using isLockOn() incorrectly, or is this a bug ?