version 2.0.3 type("c",Key.CTRL) not in Env.getClipboard()

Asked by Aaron Prince on 2020-03-19

Using Version 2.0.3
I am unable to get save a new value in the clipboard.
I've tried the following:
keyDown(Key.CTRL)
wait(1) # the waits were added in case that was an issue
doubleClick(Region(352,447,115,37))
wait(1)
keyUp()
wait(3)
type("c",Key.CTRL)
wait(3)
value = Env.getClipboard()
print value # returns last thing I copied and not what was highlighted on the screen when ctrl+c was sent

drag(Region(275,424,92,19).getTopLeft())
dropAt(Region(275,424,92,19).getBottomRight())
wait(0.25)
type("c",Key.CTRL)
wait(0.15)
value = Env.getClipboard()
print value # returns last thing I copied and not what was highlighted on the screen when ctrl+c was sent

I also can't get the mouse click + ctrl combo to work:
click(Region(275,424,92,19), 2) # 2 is KeyModifier.CTRL

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2020-03-20
Last reply:
2020-03-20
RaiMan (raimund-hocke) said : #1

Cannot reproduce your problem (using 2.0.4 on Win10).

This works (a webpage in Edge showing your question):
for n in range(2):
    click()
    wait(1)
    r = Region(349,486,65,19)
    r.highlight(1)
    r.doubleClick()
    wait(1)
    type("c", Key.CTRL)
    wait(1)
    print App.getClipboard()
    click()
    wait(1)
    r = Region(35,488,63,17)
    r.highlight(2)
    r.doubleClick()
    wait(1)
    type("c", Key.CTRL)
    wait(1)
    print App.getClipboard()

and prints absolutely correct:

[log] CLICK on L[960,600]@S(0) (525 msec)
[log] highlight R[349,486 65x19]@S(0) for 1.0 secs
[log] DOUBLE CLICK on L[381,495]@S(0) (554 msec)
[log] ( Strg ) TYPE "c"
highlighted
[log] CLICK on L[960,600]@S(0) (537 msec)
[log] highlight R[35,488 63x17]@S(0) for 2.0 secs
[log] DOUBLE CLICK on L[66,496]@S(0) (551 msec)
[log] ( Strg ) TYPE "c"
value
[log] CLICK on L[960,600]@S(0) (538 msec)
[log] highlight R[349,486 65x19]@S(0) for 1.0 secs
[log] DOUBLE CLICK on L[381,495]@S(0) (554 msec)
[log] ( Strg ) TYPE "c"
highlighted
[log] CLICK on L[960,600]@S(0) (524 msec)
[log] highlight R[35,488 63x17]@S(0) for 2.0 secs
[log] DOUBLE CLICK on L[66,496]@S(0) (552 msec)
[log] ( Strg ) TYPE "c"
value

BTW: I have no idea, what CTRL+click should do?

Aaron Prince (mraaronprince) said : #2

thanks for the quick reply. I don't know why it isn't working.
CTRL+ left click highlights the contents of the text box I want to copy. I'm trying to copy something from a web app in IE.

RaiMan (raimund-hocke) said : #3

Cannot reproduce, sorry.

Aaron Prince (mraaronprince) said : #4

I tried it on my physical laptop and it it worked fine. It only doesn't work when running from my virtual machine. Is there a different clipboard that I need to access to get the values copied?

Manfred Hampl (m-hampl) said : #5

Which virtualization system do you use?
I know that on Virtualbox you have to enable "Clipboard sharing" to be able to copy/paste from guest to host and vice versa, see https://www.liberiangeek.net/2013/09/copy-paste-virtualbox-host-guest-machines/
Maybe you are running into such kind of limitation.

Aaron Prince (mraaronprince) said : #6

I'm using VMware Horizon Client. I think I want what your link suggests, I just need to figure out how to only use my VM clipboard instead of the my physical machines clipboard.

It looks like this is a VM issue for me and not a Sikuli one.

Thank you all for your help.

Can you help with this problem?

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

To post a message you must log in.