Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send "Ctrl + c" in Sikuli?

Tags:

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?

like image 757
Dave S Avatar asked Jun 13 '11 23:06

Dave S


People also ask

How do you right click on sikuli?

Execute a mouse right click action on a target. To define a right-click action, write the word right click in a text box. You can also write aliases such as right-click or rightclick . Then, draw a rectangle around the target.


2 Answers

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) 
like image 137
Jompa234 Avatar answered Sep 22 '22 22:09

Jompa234


The following works in 0.9 and newer versions of sikuli

type('x', KeyModifier.CTRL) 
like image 40
spearson Avatar answered Sep 18 '22 22:09

spearson