Sikuli seems to be functioning fine but shift-click not working

Asked by mark on 2017-12-20

I am on Mac using sikuli 1.1.1

I am trying to shift-click on multiple items in a game. Using keyDown(key.shift) followed by multiple clicks, I can see with the Mac keyboard viewer that the shift key is in fact being held down by sikuli, but the game does not respond accordingly. Using click(image, KEY_SHIFT) does not work either. Shift-click seems to be working fine in test scripts, like typing a note or selecting multiple items in Finder.

One strange thing is that if during the process I manually tap (I don't have to hold it) the physical shift key on my keyboard, the remaining items are selected with Shift-click, as if everything is working properly.

No errors are being thrown at any point.

I'm using shift as part of my exit function (I think it's from a tutorial) could that be the problem?

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2017-12-20
Last reply:
2017-12-21
RaiMan (raimund-hocke) said : #1

might be a typo - must be:
keyDown(Key.SHIFT)

If it is not a typo:
especially games often have their special implementation of the user interface or even block actions, that are not sent by real devices.

But your manual test tells, that you might try with
keyDown(Key.SHIFT)
keyUp()
click(..)
click(...)

mark (mzk12) said : #2

Thanks for the advice. Is there a difference between when sikuli presses the SHIFT key as opposed to when it comes from the keyboard?

RaiMan (raimund-hocke) said : #3

There must be a difference:
the keyboard is hardware and goes through a driver up to the higher layers of the system.
SikuliX uses the Java AWT Robot features and surely goes directly to some higher layer in the system.
... and I am sure, that for experts and their software the origins of keystrokes are distinguishable with respect to the sources.

mark (mzk12) said : #4

Okay, thank you for all the information!

mark (mzk12) said : #5

I just checked, and a sikuli press on Shift won't set off Sticky Keys either. Interesting.

RaiMan (raimund-hocke) said : #6

what are "Sticky Keys"?

Can you help with this problem?

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

To post a message you must log in.