How to rebind the XF86RFKill (F10) media key

I’ve tried to rebind it through hyprland, but it always kills my wifi/bluetooth. Is there a way to rebind this key, or is this hardware hardcoded?

Which Linux distro are you using?
Fedora

Which release version?
41 (latest)

Which kernel are you using?
6.12.6

Which BIOS version are you using?
3.05

Which Framework Laptop 13 model are you using? (AMD Ryzen™ 7040 Series, Intel® Core™ Ultra Series 1, 13th Gen Intel® Core™ , 12th Gen Intel® Core™, 11th Gen Intel® Core™)
7040 13inch

XF86RFKill (F10) shouldn’t be hardcoded (handled in hardware). It’s been reported not to be on some Framework models at least.

You can check by turning on Airplane mode and doing

rfkill list all

Hardware RFkill will be listed as “Hard blocked: yes”.
In that case, the EC (Embedded Controller), or a physical hardware switch is using the RFkill pin on the Wifi/BT module, and that is outside of OS control. Those that have a malfunctioning hardware RFkill would need to apply tape over the RFkill pin to block it.

Presuming it’s not hardware RFkill, then you can rebind it or just disable it if you wish. But keys like RFkill (OS / software RFkill) are normally handled at a lower level than regular hotkeys. See Map scancodes to keycodes - ArchWiki (a great deal of infomation on ArchWiki applies outside of Arch as well).

TL;DR - this should do it
Create
/etc/udev/hwdb.d/99-keyboard-rebinds.hwdb

# /etc/udev/hwdb.d/99-keyboard-rebinds.hwdb
# reload / rebuild database after charges using sudo udevadm hwdb --update && sudo udevadm trigger
#
# format:  evdev:input:b{bus}v{vendor}p{product}
#
# Framework Laptop 13 RFkill key
# bus 0018 vendor 32AC product 0006

evdev:input:b0018v32ACp0006*
  KEYBOARD_KEY_100c6=f10

To just disable RFkill instead of binding to F10, you can use =reserved

Then do

sudo udevadm hwdb --update && sudo udevadm trigger

Disabling Flight Mode / Airplane Mode Function Key F10 - is it possible? - #13 by aaz2234

1 Like

Thank you very much for this clear post. I’ve changed it a bit and moved my other (xkb) keybind to the config as well. I didn’t know this was possible with udev and thought I needed a 3rd party tool, so very cool.

For others, stumbling on this post, I bound it to prog1 so that I can bind XF86Launch1 in hyprland. Also rebound capsescape without terrible xkb config:

# Rewrite RFKILL (airplane mode) of the `wireless device` to `prog1`.
evdev:input:b0018v32ACp0006*
  KEYBOARD_KEY_100c6=prog1

# Rewrite `capslock` to `escape`.
evdev:input:b0011v0001p0001*
  KEYBOARD_KEY_3a=esc
1 Like