Super User Asked on December 3, 2021
tl;dr:
Why do I never see power buttons anymore on USB keyboards? I feel like they were very common on PS/2 keyboards.
Is it a limitation in the USB-protocol, i.e. no suitable packet "ok host, power off" exists?
I did find "system controls" in the HID Usage Tables (v1.12, section 4.5.1), but the HID itself (v.11, section 4.2) remains too vague for me.
"Because the parser for the Report descriptor represents a significant amount of code, a simpler method is needed to identify the device protocol for devices requiring BIOS support (Boot Devices). HID class devices use the Subclass part to indicate devices that support a predefined protocol for either mouse devices or keyboards (that is, the device can be used as a Boot Device). The boot protocol can be extended to include additional data not recognized by the BIOS, or the device may support a second preferred protocol for use by the HID class driver.The bInterfaceSubClass member declares whether a device supports a boot interface, otherwise it is 0."
Subclass Code Description:
So if I get this correctly, a keyboard needs to send a descriptor with bInterfaceSubClass
set to 1, as well as protocol code 1 (keyboard)?
And when a power button is pressed, it sends scancode 0x66 (KEY_POWER).
Am I correct in my assertions? If so it doesn’t seem like a big deal, so why do I never find keyboards with power buttons anymore?
Still, that’s just for shutting down a pc. Is there a way a usb device can turn on a host? This used to be possible with ps2 keyboards (granted, you often had to enable it in the BIOS, but still).
P.s. the reason for asking is because I’m annoyed to have to reach over the the power button. I’d much rather have a power button than a useless scroll lock or pause break.
Power buttons on PS/2 and USB keyboards were always just a different scan code from other keys, no special hardware involved. Power off support is just dependent on the OS watching for this scan code and triggering their normal shutdown dialog. Power on support involves the firmware watching for this scan code and treating it like the power button being pressed.
They've fallen out of favor as distinct keys on detatched keyboards for a couple of reasons:
Note, however, that some firmware implementations do support other key sequences for power on. A number of the systems where I used to work would accept Ctrl+Space to trigger a power on for example (though they required other methods for shut down).
Answered by Austin Hemmelgarn on December 3, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP