In Mac, combinations of the power button (Shift+Power or double press it to restart) are possible, as if it's just a normal button on the keyboard. It can also be configured in Windows 8.1 and Linux too, but only for a single press. Is it possible to have more combos with that button? Maybe a tweak in BIOS or install a third party software will work?
1 Answers
Everything is done differently on a Mac. Its power button is a normal button which generates some scancodes. Even the Fn button is normal on a Mac, whereas it's not visible to the OS on a PC, which is why you often have no way to remap the Fn button except swapping it with Ctrl by some setting in BIOS. In PCs the power button connects with the power supply instead.
In PCs with AT power supplies it's a hard switch button which disconnects the PC from the power source when turning off (which is why the It's now safe to turn off your computer message exists). So the OS doesn't even have a chance to know that the button was pressed before it dies, and you can't capture the button
In PCs with ATX power supplies the button connects with the power supply and not with a keyboard controller, so you don't get a scancode and can't use it in a combo key. The button event is sent to the OS via ACPI commands. Some BIOS setup utilities allow you to change the behavior of that button, such as sending restart, sleep ACPI commands or do nothing. You can capture the shutdown event in the OS though, although with some caveats in modern Windows versions. It'll be significantly slower than a normal key press, and probably not suitable for typing or sending shortcuts but may be OK for your use-case
- Run a program on: hard “Power” button press
- Hook system power button in Windows
- Can the power button of a PC or laptop be remapped?
- Change Behavior of Linux Power Button
- How can I Execute a Function when Windows Shut down
- Hook system power button in Windows
- How to detect power button event and deny it on windows 7 from laptop
So you can set the power button to sleep, and run a command to restart on sleep event, or capture the power button directly and restart.
But if you just want to force a hard reset without a reset button then it's much simpler to hold down power button for a few seconds to force shutdown, then start it again.
It's a bit easier if you want to start the PC, since most desktop BIOSes allow you to wake up or start the computer from off state by pressing a key or key combination on the mouse/keyboard, probably because in many situations the CPU case is put in somewhere not reachable by the user. But I've never seen a laptop with that feature, and no laptop BIOS allows you to press both a key on keyboard and power key too, since you always have easy access to the laptop's power button. You can also start the PC remotely with a wake-on-LAN magic packet
- 30,396
- 15
- 136
- 260
