How to send alt+printscreen command from sikuli?

Asked by gnimsh

I'm testing a page heavy on javascript and specifically I'm using a search box which pops up results as you type, however the moment you click on GreenShot (or anywhere else) the dropdown disappears, so I'm unable to take a screenshot of it. However the program uses alt+printkey as a shortcut, and when I use this the dropdown remains.

So far I've tried a number of things unsuccessfully.
keyDown(ALT)
type(key.PRINTSCREEN)
keyUp(ALT)

Here alt is undefined

If I add keyDown(key.ALT) then sikuli returns "name 'key' is not defined."

This is the 2nd thing I've tried: type(key.PRINTSCREEN, KeyModifier.ALT). It still returns "name 'key' is not defined".

Thanks for your help!

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

the notation of the keys needs an uppercase K (a class name, the docs would have told you ;-)

type(Key.PRINTSCREEN, KeyModifier.ALT)

or

keyDown(Key.ALT)
keyDown(Key.PRINTSCREEN)
keyUp()

Can you help with this problem?

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

To post a message you must log in.