A few years ago Dan Berrange added a way to send fake keyboard events to libvirt guests. You can use this to inject just a press on the Left Shift key to wake up a guest from screen blank. Very useful if you need to take a screenshot!
$ virsh send-key guest KEY_LEFTSHIFT $ sleep 1 $ virsh screenshot guest /tmp/screenshot.ppm
Update: A word of warning though. If you try this for Windows guests you’ll hit this message:
The solution is to hit other keys randomly. Grrr.