What I am trying to accomplish:

To re-map a laptop's power button that is absurdly placed as a key in the keyboard.


I have recently bought an upgraded version of ASUS VivoBook Pro N552VW laptop. It is a great machine, with great specs. I like every single detail in it, except one thing that I simply cannot swallow, nor can I understand why on Earth it exists.

A product-design genius decided that the power button to turn the computer on and off should be located among the keyboard keys. Even wiser, the genius decided that it should be placed where one usually finds the dedicated "End" key, as it can bee seen in the picture below:

enter image description here

Alleviating the problem:

While that design is obviously error prone, i.e. there is always the risk of one pressing the power key by accident and then putting the laptop to sleep in the middle of a working session. But that is easy to solve, by going to Windows' power settings and defining nothing to happen when power buttons are pressed. Se picture below:

enter image description here

What remains to be done:

However, what I would really like to do is to map such key to behave as if it were a dedicated End key again. I have tried multiple key mapping software, but none worked. I know that power keys are often mapped to the BIOS powering process at a rather low level, thus I was about to give up.

That is when I found this question at the AskUbuntu Stackoverflow: https://askubuntu.com/questions/580902/how-to-change-mapping-for-the-poweroff-key-on-keyboard

There, a solution is given for Ubuntu OS. It then gave me back hope that doing the same under windows might be possible. Therefore, my question here: how could I properly re-map the silly Asus power button to behave as if it were an "End" key?

My preferred solution would be doing that via Windows registry. Only if that is not possible at all I would like to experiment the option of using external re-mapping softwares that have to be loaded all time.

What have I tried exactly:

I have actually tried both changing the registry and also using external software. No free software that I could find allowed me to properly re-map the power key.

Changing the registry, the best I could find out is to make NumLock key become the End key (then NumLock would be accessed by Ctrl+Alt+PauseBreak):

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout

"Scancode Map"= 00,00,00,00,00,00,00,00,03,00,00,00,4f,e0,45,00,45,00,46,e0,00,00,00,00

Needless to say, this stands out as a rather dirty solution since it creates more mess.


Use SharpKeys to see if the Power key generates a scan-code on your keyboard. If it does, then SharpKeys can remap the key in the registry which will work for all programs.
See for tutorial the article Map Any Key to Any Key on Windows 10, 8, 7, or Vista.

In the case that the Power key doesn't generate a scan-code under Windows, then it cannot be mapped, only disabled just as you did. Even if Linux can remap it because it affords better control over the keyboard, this is then not the case for Windows.

The most you can do in this case is to reactivate the Power key and reset it back to do again power-down, and then trap and cancel that event, remapping it to another key such as the End key. This can be done by using AutoHotkey, but may be more trouble than it's worth. If you are interested I can expand my answer to show how this is done.

I do note that sometimes using the Power button is the only way to shut down a hanged computer in a semi-orderly manner.

  • If you are referring to the shutdown prevention script in AHK:OnMessage, note that "this is reported NOT to work on Windows Vista and later". Else I'd like to see your magic.
    – guest-vm
    Feb 26 '18 at 9:35
  • @guest: There are several such scripts to be found. I believe that an API program can cancel the shutdown, no magic involved, so AHK should be able to do it too. But as I said, this might not be worth the trouble of pointing the poster at these links and asking him to invest his time in checking them out, as these solutions may not be guaranteed to work for all cases.
    – harrymc
    Feb 26 '18 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.