Is there a way to remap F12 key on Windows 11 without powerkey or any other app?
bumping this old topic.
I would like to remapp F12 too. Pop!_OS currently set it to either totem or firefox⌠which I want to change to âsettingâ
I Have the exact same problems. Would love to remap it to go to sleep, since my power button is hibernate. Shouldnât be too difficult I thought. I tried to make a script run (From registry) but that didnât work. Remapping via VIA also doesnât work for some reason. I map it to Sleep, then it does nothingâŚ
I have it mapped to the calculator, but I use two different Power Toys to make it work.
Finally got it to âworkâ.
Installed Autohotkey and made a Win+x - U - S script to enter sleep mode
Went to the registry and selected that .exe autohotkey script to execute when pressing the button. Now the laptop goes to sleep. Iâd rather see Framework give the option to change it (since selecting âsleepâ in VIA settings does nothing).
You can actually remap the F12 key without PowerToys, just with a registry entry. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AppKey\16 and create a string key named âShellExecuteâ. I have mine set to âC:\Windows\System32\calc.exeâ to open the calculator.
Sadly there isnât an easy way to map âsleepâ to this button. There is no sleep.exe or something similar.
Try this: Is there a command line tool to put Windows 8 to sleep? - Super User
Not sure if you can do arguments directly in the ShellExecute value. if not, put it all in a batch script and call that.
Edit: just to make sure this is not an XY problem: is there a reason why you donât configure the power button to send the laptop to sleep?
I mapped the power button to hibernate.
But hey, I got it to work so thatâs nice.
The link you attached didnât work in the couple minutes I spent to get it to work.
The symbol XF86AudioMedia
is assigned for the F12 media key in Linux.
https://wiki.archlinux.org/title/Framework_Laptop_13#Function_keys
I am assigning the firefox <specific url>
for the F12 media key on my window manager Sway in Linux. Below is my Sway config file. Though I am not sure which window manager you are using.