type(Key.DELETE, Key.CTRL , Key.ALT), it can't lock my computer

Asked by Stranger

I want to lock my computer, and use function, type(Key.DELETE, Key.CTRL , Key.ALT), but it dosen't work.

And I found some other shotcut key by type function, but they don't work either, such as
type("L", Key.WIN)
type("E", Key.WIN)

My OS is windows7

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Stranger
Solved:
Last query:
Last reply:
Revision history for this message
Stranger (peterlee007) said :
#1

I found the answer for type("E", Key.WIN), the correct input is type("e", Key.WIN)
But for type("l", Key.WIN), it still dosen't work

Revision history for this message
TestMechanic (ndinev) said :
#2

If your goal is to lock windows machine use this Sikuli command

run("rundll32.exe user32.dll,LockWorkStation")

Revision history for this message
Stranger (peterlee007) said :
#3

Thanks, your command works fine.
I just study SikuliX, and I still want to know why type("l", Key.WIN) and type(Key.DELETE, Key.CTRL + Key.ALT) can't work in SikuliX, could you tell me the reason?

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

This is a restriction of the underlying Java Robot class, which is used to simulate keystrokes.

Revision history for this message
Stranger (peterlee007) said :
#5

Thanks, RaiMan, SikuliX give me much help in my work! Hope SikuliX become more useful in next version!