Fast tab switching on Chrome using CMD+alt+right

Asked by diego on 2019-12-16

I am trying to go fast tab switching on Chrome using CMD+ALT+Right via the following line:

type(Key.CMD, Key.ALT+Key.RIGHT)

but it doesn't work

Any thoughts?

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
diego
Solved:
2019-12-16
Last query:
2019-12-16
Last reply:
2019-12-16
Manfred Hampl (m-hampl) said : #1

Don't confuse special keys and key modifiers.
See https://sikulix-2014.readthedocs.io/en/latest/keys.html

Try

type(Key.RIGHT, Key.ALT+Key.CMD)

diego (adrian-veidt) said : #2

That did not work either. I tried

keyDown(Key.CMD)
keyDown(Key.ALT)
type(Key.RIGHT)

And other things using keyDown and no luck.

I suggest you open Chrome and try it yourself

Manfred Hampl (m-hampl) said : #3

Which operating system and which sikuli version do you use?

diego (adrian-veidt) said : #4

The problems was that sikuli did not change context to Chrome upon running. switchApp("Google Chrome") and then :

type(Key.RIGHT, Key.ALT+Key.CMD)

or

keyDown(Key.CMD)
keyDown(Key.ALT)
type(Key.RIGHT)

did the deed.

Manfred Hampl (m-hampl) said : #5

… and using that key combo on my system turns the screen sideways.