Just put the PC into sleep mode. The PC must be capable of S3 sleep. Then the keyboard or mouse will wake it up. If nuisance wakes occur, disable wake for the problem device up in Device Manager. That's sometimes needed for the mouse since minor movements can trigger it.