Using Leonardo as keyboard: add wake and sleep functions
It turns out there is a library that can be added to compile the media and system functions for USB keyboard connection into the Leonardo, as well as other Arduino modules. It is available through 'tools','library manager'; it is HID-project by NicoHood. There is an example program called &quot;system example&quot; at github to test it for for wake and sleep. It works perfectly.
I expect it'll work for the other functions too.