← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #207360]: Java: How to slow down a key combination

 

Question #207360 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/207360

    Status: Open => Answered

scott f proposed the following answer:
Hi Boipelo,

I have a guess as to your problem. The way you coded it, I think you are
first typing "ALT + SPACE" and then typing "ALT + N".

I have never used the "Screen" class, so I don't know if the your syntax
with s.type() is right, but perhaps try something like this:

Screen s = new Screen()
keyDown(Key.SPACE) # press and hold the SPACE key
s.type(null, 'n', KeyModifier.CTRL) # type "CTRL + N"
keyUp(Key.SPACE) # release the SPACE key

Let me know if that works!

Sidenote:
If I were trying to type CTRL + ALT + N I would have used:

type('n', KeyModifier.CTRL + KeyModifier.ALT)

Unfortunately, the SPACE key is not allowed as a 'KeyModifier'. Not sure
why!

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.