SIKULI API - How to use type with special combination keys like ALT+TAB

Asked by Elaine

I started one application and I need acess another application with special combination keys like ALT+TAB.

I write the following code, but nothing happened:

DesktopKeyboard keyboard = new DesktopKeyboard();
keyboard.type("\ue022"+"\t");

I try to use key constants, but it does not work.

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
Edmundo VN (edmundo-vn) said :
#1

type("\t", KeyModifier.ALT)

Revision history for this message
Elaine (elaine-navalho) said :
#2

Thanks Edmundo,

The command "type("\t", KeyModifier.ALT)" work well in Sikuli IDE, but I use sikuli-api in a java program, the constant KeyModifier.ALT does not exists.

Revision history for this message
Edmundo VN (edmundo-vn) said :
#3

The KeyModifier class is inside the package org.sikuli.script, did you imported it?

Revision history for this message
Elaine (elaine-navalho) said :
#4

Hello Edmundo,

I use the sikuli-api-1.0.2-standalone.jar, I did not find the sikuli-script.jar for download.
Where I can find it?

Thank you,

Revision history for this message
Edmundo VN (edmundo-vn) said :
#5

In this jar file KeyModifier seems to be inside org.sikuli.api.robot.

import org.sikuli.api.robot.KeyModifier;

Revision history for this message
RaiMan (raimund-hocke) said :
#6

@Elaine
sikuli-api-1.0.2-standalone.jar is not API compatible to SikuliX (the IDE you are using also).

If you want to program in Java and yes SikuliX features, you have to setup according to http://sikulix.com

Can you help with this problem?

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

To post a message you must log in.