env.isLockOnSync always return false

Asked by BIPIN

hii all, i m using nodejava to check weather my caplock is on or off but env.isLockOnSync always return false.
typesync(key.NUM_LOCK) work great, but don't know why isLockOnSync not working

   let offcap = this.Env.isLockOnSync(y)
        console.log(offcap, typeof offcap, this.Key.NUM_LOCK, this.Key.NUM_LOCK.toString())
        if (offcap == true || offcap == "True" || offcap == "true") {
            let x = this.screen.typeSync(this.Key.NUM_LOCK);
            this.wait(null, 0.2);
            console.log("---------------cap", x, typeof x)
        }
is there anyother work around to get numlock status

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

what version of SikuliX?

Revision history for this message
BIPIN (nbipin) said :
#2

@RaiMan sorry for not describing version. its 2.X (i think 2.0.4)

Revision history for this message
BIPIN (nbipin) said :
#4

java verision

java 11.0.6 2020-01-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.6+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)

Revision history for this message
BIPIN (nbipin) said :
#5

 let offcap = this.Env.isLockOnSync(this.Key.NUM_LOCK)
        console.log(offcap, typeof offcap, this.Key.NUM_LOCK, this.Key.NUM_LOCK.toString())
        if (offcap == true || offcap == "True" || offcap == "true") {
            let x = this.screen.typeSync(this.Key.NUM_LOCK);
            this.wait(null, 0.2);
            console.log("---------------cap", x, typeof x)
        }

output result false, 'boolean' , '[]' , '[]'

Revision history for this message
BIPIN (nbipin) said :
#6

sorry if found that my sikuli version is 2.0.2

Revision history for this message
BIPIN (nbipin) said :
#7

one more think i notice that using IDE it work correctly but when i use it through code it doesn't can i know reason why?

Revision history for this message
RaiMan (raimund-hocke) said :
#8

Running on Windows?

Revision history for this message
BIPIN (nbipin) said :
#9

yes it window 10

Revision history for this message
RaiMan (raimund-hocke) said :
#10

ok, then it must be a problem with node java.

Sorry, but I cannot help you.

Can you help with this problem?

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

To post a message you must log in.