by the way, you mistyped it in the second scrip
thx edited (typo cause there’s no way to copypaste from dom0)
One reason this might not work is that your modifier key (Win?) for this is still depressed while the script is being executed.
Actually I tried it with Ctrl+Alt+,. and Ctrl+C\V (but concern on key being pressed is still reasonable).
Just for testing if you increase the first sleep to 1 second and make sure that you don’t press any keys when this is executed, does the situation improve?
0.2: Paste working, copy doesn’t
1: Paste working, copy doesn’t
1 but trying to depress on copy real fast: TOTALLY WORKS. Thanks.
I changed delays from 1s everywhere to 0.2 + 0.2 on paste, still works. Copy does not work on 1 + 0.2 or 0.2 + 1, 1 + 1 only. Tried Win\Meta\Super+C\V, also F7\8+C\V, same result on delays (copying does not happen, but writing to interVM-clipboard maybe does, there’s notify about it).
Maybe only first emulated shortcut is messed by trigger key(s), if second working properly? Aaaaand yes that’s the fix. /bin/bash -c "sleep 0.1 && xdotool key ctrl && sleep 0.1 && xdotool key ctrl+c && sleep 0.1 && xdotool key ctrl+shift+c" perfectly works.
But with Ctrl+C as a trigger this does not work at all, also this keystrokes sequence can stop stuff if you’d try to copy text from terminal. Maybe there’s some console way of copying in VM’s clipboard? Still win though.
I believe there is a way to get the window ID first, and then send both keystrokes to the same window.
It wouldn’t work if focus changes after emulated end copy and before physical start of paste. So only protection from change focus after (start of?) physical keystroke and before emulated keystrokes (which is time-possible because of two waits).