2

Sikuli X我可以使用类似的东西

type("x", KEY_CTRL)

我怎样才能在Sikuli API中做同样的事情?

4

3 回答 3

1

我在我的项目中这样使用:

Screen screen = new Screen();

screen.click(<your texbox>); // click into textbox to have a cursor there

screen.type("a", KeyModifier.CTRL); // this sends Ctrl+"a" to select all text <- this is what you asked for !
screen.type(Key.BACKSPACE); // this sends Backspace key pressed, i.e. here deletes all selected text

请注意,我同时使用了 KeyModifier 和 Key。这样它就起作用了。

于 2013-04-29T13:04:16.927 回答
1

试试这个,

Screen screen = new Screen();
screen.type("x",Key.CTRL)
screen.type("\n");
于 2015-06-29T10:21:32.340 回答
0

使用KeyEvent中的键码:

DesktopKeyboard keyboard = new DesktopKeyboard();
keyboard.keyDown(KeyEvent.VK_CONTROL);
keyboard.type("x");
keyboard.keyUp(KeyEvent.VK_CONTROL);
于 2013-04-08T04:33:45.580 回答