[RESPONDED] Waking from suspend w/ lid closed

We were just discussing the keyboard behavior last week! and if we should change this to avoid key-presses in bags during suspend.

Hardware wise we have a sleep hardware indicator to the keyboards, and this is controlled by the OS transitioning between S0 and sleep.

We were discussing if we should change this control signal from a sleep indicator to a lid closed indicator. And block key events from the keyboard in sleep.

Cutting power to the input modules on lid closed is possible in hardware, but I think we run into OS issues where usb will detect a disconnect, and the OS will wake up again. Which causes problems with properly entering sleep. @Mario_Limonciello is there a way we can disconnect devices from usb in a safe way during suspend entry, and exit to prevent the os from waking again?

We have spent some time debugging selective suspend issues in QMK, as we see when it is enabled, you can lose hid packets to the host, which results on stuck keys on resume if you wake up by key press, this has a low failure rate, but still enough to be buggy.

We also found using the MSOS2 descriptor was not always applying selective suspend settings correctly in windows.
Selective suspend support for HID is not enabled in windows/linux by default due to poor device support.

3 Likes