Remapping the `fn` key

10,728

Fn keys generate ACPI events and not keyboard events. To echo the keypress for Fn to the terminal use ...

sudo acpi_listen

Pres Fn + F12 and it will show

button/volumeup VOLUP 00000080 00000000 K. 

This connects directly to the hardware and is OS independent. Remapping is out of the question.

Here is an interesting read about kernel and a keymap. But that goes beyond a basic changing of keycodes and it does not deal with setting the control key to act as an Fn.

Share:
10,728

Related videos on Youtube

Juicy
Author by

Juicy

Updated on September 18, 2022

Comments

  • Juicy
    Juicy over 1 year

    PLEASE NOTE: This is not a duplicate as the fn key behaves differently than other keys on the keyboard. I can't get the fn keycode by using, for example, xev.

    I'm running Ubuntu on my Macbook now. I'm using the Macbook UK keyboard layout for input, which works fine and has all the keys in the correct positions.

    The one thing I never got used to on my Macbook is that the fn and ctrl keys are swapped over from what you would usually see in most UK laptops' keyboard layouts.

    enter image description here

    Can I reconfigure my keyboard layout in Ubuntu so that the fn key in the picture above becomes ctrl, and vice-versa (while keeping all others keys exactly the same)?

    This is tricky because the fn key doesn't seem to behave like other keys. You can't get the fn keycode by running xev. Every other answer to this question I've found doesn't apply when dealing with the fn key, as they depend on getting the keycode from xev.

    How can I remap fn to ctrl and vice-versa?

    I will welcome any "hackish" idea or solution.

    (I'm on Xubuntu 16.04)

    • Rinzwind
      Rinzwind over 7 years
      Fn keys generate ACPI events and not keyboard events. sudo acpi_listen and press a Fn + volUp will show button/volumeup VOLUP 00000080 00000000 K. It connects directly to the hardware so is OS independent. Remapping probably is out of the question.
    • Admin
      Admin over 7 years
      Take out the probably and make it an answer. It's brilliant and concise as it is.
    • Bill Moon
      Bill Moon almost 6 years
      I finally found something that works for me: github.com/free5lot/hid-apple-patched
  • That One Actor
    That One Actor about 7 years
    How can I remap which fn combinations correlate with actions?
  • jpoppe
    jpoppe over 5 years
    On Arch: sudo pacman -S acpid && sudo systemctl start acpid && acpi_listen