Way to switch `Fn` and Right-`Control` key?

One of the first settings I change in macOS is switching the Fn and right-Ctrl key. This is done somewhere in the settings.

Im looking for something similar in Fedora Asahi. I have the XFCE version installed as well as the swaywm. Preferably I would like to know how this can be done in sway.

More generally: Im used to setting this sort of thing in the BIOS (i.e. on my Thinkpad I can make this switch there and it is persistent for all users, OS, etc.). Is something like this currently possible or planned?

Look at sway-input : sway/sway/sway-input.5.scd at master · swaywm/sway · GitHub

There are also some example here : Home · swaywm/sway Wiki · GitHub

You can probably get the behaviour you want through some libinput tweaks.
Hope that helps

Hi @jbtrystram

Thanks for the links. Im sorry, but I seem to not follow the logic here.

Looking at man 7 xkeyboard-config in the OPTIONS section, which as far as I understand should list all possible xkb_options that exist, there are lots of ways to modify the order of the Ctrl, Alt and Super-keys, but not really for the Fn key.

Also using xev I can retrieve keycodes for all keys except for the Fn key. Only by pressing it in combination with another key do I get a keycode (i.e. of the Fn+other key). This to me indicates that the Wayland (and consequently sway) wont be able to change its behavior.

Sorry if Im missing something basic and thank you for your time!

Also using xev I can retrieve keycodes for all keys except for the Fn key. Only by pressing it in combination with another key do I get a keycode (i.e. of the Fn+other key)

Yeah, that means that the keyboard is not sending codes whrn you only press Fn.
Consequently, the OS could not know if you are pressing the key, if nothing is received :frowning:
I don’t see any way to fix that, except rewiring the keyboard PCB

Fn is not handled in the OS or at xkb level. There is a driver option for hid_apple, which is reported to work for x86 Macbooks. Don’t know if Apple Silicon uses the same keyboard controller and the driver though.

Worked like a charm. For future reference one can set

# /etc/modprobe.d/hid_apple.conf
options hid_apple swap_fn_leftctrl=1

and then run

sudo dracut --regenerate-all --force

To get the above behavior.