javasikuli

How to type special key using Sikuli Java Standalone jar?


In Sikuli X I can use something like

type("x", KEY_CTRL)

How can I do the same in Sikuli API?


Solution

  • Use the key codes in KeyEvent:

    DesktopKeyboard keyboard = new DesktopKeyboard();
    keyboard.keyDown(KeyEvent.VK_CONTROL);
    keyboard.type("x");
    keyboard.keyUp(KeyEvent.VK_CONTROL);