Scroll lock issues

Asked by Tim Tindell

I am trying to get the Env.isLockOn(Key.SCROLL_LOCK) to work for me, but it seems that it only works if you manually press the numlock key to start. What I mean is if you have sikuli press the NumLock key, and then check to see the change using the Env method it will always return what happened before sikuli pressed it.
Run this to see what I mean:
t=Env.isLockOn(Key.SCROLL_LOCK)

print t
if t==False:
    type(Key.SCROLL_LOCK)
else:
    pass
t=Env.isLockOn(Key.SCROLL_LOCK)

print t
t=None
if t==False:
    type(Key.SCROLL_LOCK)
else:
    pass
If num lock has been manually set to on is will always show true(which is good), but if you turn off num lock manually, and run the program, it will always show false, even though sikuli does turn on and off numlock.
If I am doing this wrong please let me know.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

This is a known problem caused by Java.

possible workaround:
You might check the NumLock situation before dealing with ScrollLock and press the NumKey if needed.

Can you help with this problem?

Provide an answer of your own, or ask Tim Tindell for more information if necessary.

To post a message you must log in.