How to send "Ctrl + c" in Sikuli?

Dave S picture Dave S · Jun 14, 2011 · Viewed 55.3k times · Source

This feels like it should be pretty easy but I can't find documentation on how to do this:

I just want Sikuli to type Ctrl+C to copy text to the clipboard.

type(KEY_CTRL+'c') doesn't work and neither does type(KEY_CTRL,'c').

Any suggestions?

Answer

Jompa234 picture Jompa234 · Jun 14, 2011

Try using type("c",KEY_CTRL) instead.

I wrote a simple script which types a line in notepad, double clicks it to mark it and then ctrl+x ctrl+v it into the document again. Works great.

openApp("notepad.exe")

find("textfield.png" )
type("Some text")
doubleClick("theText.png")

type("x", KEY_CTRL)

click("theTextField.png" )
type("v",KEY_CTRL)