I use an Apple Wireless Keyboard over Bluetooth, and all the function/media keys are set up perfectly. However, I never use the hardware ‘Eject’ key and want to remap it to ‘Delete’. When I remapped the keycode in
~/.Xmodmap, it works, but only until I suspend and wake my computer, whereupon I need to manually reload
I’ve previously used the options in Keyboard -> Layout -> Keyboard Layout Options to e.g. swap Right Ctrl & Right Super, enable the Compose key, etc, and these seem to be persistent, but they’re not stored in the Xmodmap configuration (I think). Are these flags that the DE is setting in xkb? Is there a way to remap Eject to Delete using the same mechanism? Thanks
This Arch wiki entry mentions a module in the AUR, hid-apple-patched-git-dkms, that it says would accomplish what you’re looking for, but the DKMS stuff it involves is over my head to explain or help with. Definitely read the comments on the AUR page before proceeding with it too.
Thanks for this! That Arch article looks really useful. I think that I had stumbled across the
hid-apple-patched-git-dkms option before, but thought it would affect the function/media keys in a way I didn’t want. I see now that it seems possible to configure it to only affect the ‘Eject’ key and otherwise leave the default driver behaviour untouched. The whole process does look a bit intimidating though. Maybe I’ll try to find a way to make a custom Xmodmap config persist across suspend/wake before I try the DKMS route.