type("i", KeyModifier.CTRL + KeyModifier.SHIFT) does not work on Mac

Bug #1696381 reported by Devendra
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Opinion
Undecided
RaiMan

Bug Description

I have an application which handles "Control + Shift + i" keys combination.
The application is NodeJS based and it is supported on Ubuntu, Windows and Mac.

When I execute type("i", KeyModifier.SHIFT + KeyModifier.CTRL) on windows, it works well. But on Mac, it does not work.

Before executing this line, I activate the window of my app by clicking it.
Also, I am able to use the keys manually in the aplication but not through sikulix script.

My guess is that the issue is related to "Control" key handling on Mac.
I verified that the type() function works with the SHIFT and Command key modifiers on Mac.

SikuliX version: 1.1.1
MacOS: OS X EI Caption 10.11.6 (MacBook Pro)

Revision history for this message
RaiMan (raimund-hocke) wrote :

Just checked on Mac - this works:
(switches tabs in Safari)
switchApp("Safari")
wait(1)
type(Key.TAB, Key.CTRL)
wait(2)
type(Key.TAB, Key.CTRL + Key.SHIFT)
wait(2)

So it might be, that according to some "convention" for you key combination it is
type("i", Key.SHIFT + Key.CMD)
on Mac

Changed in sikuli:
status: New → Opinion
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.2
Revision history for this message
Devendra (sw.devendra) wrote :

Hi RaiMan,

Thank you very much for the quick reply!
I love your SikuliX tool :)

Coming to the problem, I tested the same on Safari too. Yes, on Safari it works.

But for that particular application it does not work.
The application responds when I press i + Ctrl + Shift manually.

Actually, now it looks something related to keyboard focus on Mac.
When I use switchApp() to switch focus to that app, the function fails with -1 error.
I observed that SikuliX IDE also does not take keys (I cannot type) after it comes in front again after executing a script.
To start typing again in the IDE, I need to switch to some other app and then come back to the IDE.

Revision history for this message
RaiMan (raimund-hocke) wrote :

-- To start typing again in the IDE, I need to switch to some other app ...
This is a known problem and you have the workaround. Every time I have this problem on my own, I wish everything to hell, but I did not find a solution until now.

-- Actually, now it looks something related to keyboard focus on Mac ...
Ok, then the given name cannot be found in the process list
(internally AppleScript is used:
set found to first item of (processes whose name is "#APP#")
where #APP# is replaced with the given string)
In the ActivityMonitor you can try to find out in the process details, which file is opened to start your app.
Or you might try with AppleScript on your own, to find out the name of your app process.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.