free5lot / hid-apple-patched

Allows to swap the Fn key and left Control key and other tweaks on Macbook Pro and Apple keyboards in GNU/Linux
GNU General Public License v2.0
350 stars 61 forks source link

Enhancement: map power button to delete #41

Open wonkothesane42 opened 6 years ago

wonkothesane42 commented 6 years ago

I have Early 2015 MBP and would love to be able to delete using one hand again instead of having to fn-backspace.

I see that you have ability to map ejectcd to delete, but there is no ejectcd button on my model macbook. Any chance there is a way to remap the power button to delete?

Thanks for reading WoNKo tHE sANe

free5lot commented 6 years ago

It can be tricky, because the power button is not a usual button and can be monitored in other way on a very low level (including hardware). E.g. long press can power off the hardware without any OS involvement, and pressing DEL for long time is quite a usual thing - to remove a bunch of chars.

So, first of all I would recommend you to find out if the system registers code of power key correctly, using xev or any gui alternative. https://wiki.archlinux.org/index.php/Extra_Keyboard_Keys

And second step - try to unbind power key in your GNU/Linux and press power key for long time, will it shutdown the computer or not. If it does power off than than I see no hope.