1

Can I remap the power-button to run a script (CMD, PowerShell, AHK...) e.g. via a registry entry under HKLMiSYSTEMlCurrentControlSetiControNKeyboard LayoutiScancode Map?

Pingui
  • 189

1 Answers1

2

No, the power button on a computer is not connected to the computer like a keyboard key is. Technically, the operating system is not aware of the power button, it sends power on/off signals through the ACPI controller on the motherboard, which is passed to the operating system as an ACPI command. Some BIOS's allow for changing what signal is sent, like shutdown/suspend/sleep. However, this is no different than changing it at the OS level.

Keltari
  • 75,447