Where are the documents that describe Linux system's sleep/wake process (note, not the states but the process) and where is the code that implements entering and exiting them?
Wake-On-Keypress is probably the most common/standard action pair on GUIs. Windows is better at Wake-On-Mouse movement. Servers should be smooth with Wake-On-Lan.
Asking here to learn/get a handle on the process as it is done currently by a common Linux GUI - Gnome. Can't find much mention of it via search engining.