Remapping the Function Key Behavior on MacBook / MacBook Pro

By | 2007/06/03

There is some built-in functionality on the MacBook hardware that I have that I have grown accustomed to, but not really enjoyed.  It has been one of those slight annoyances–something that you just kind of get used to–although it gets under your skin.  Well today I decided I had enough and hunted down the solution.  And, as is my nature, I have decided to blog my findings so you won’t have to look as hard as I have.

To reverse the function key behaviour on MacBook and MacBook Pro (I assume) you need to create an entry in one of the files in modprobe.d/.  The reason we want to do this is that, by default, the fn key behaviour is already reversed from what you might expect.  If there was such a key as fn-lock (think caps lock) imagine that being stuck on all the time.  This suggestion will fix that for you.

First, you’ll need to create a new file in the /etc/modprobe.d/ directory.  For my machine and for the sake of this tutorial we’ll call that file ‘function’.  You might use a command such as:

sudo vim /etc/modprobe.d/function

Within that file you will want to add one of the two below entries depending on your kernel version.  (If you are unsure your kernel version run the command ‘uname -r‘ to find out.)

# Reversing the fn behaviour ( >= 2.6.20 kernel)

options hid pb_fnmode=2


# Reversing the fn behaviour ( < 2.6.20 kernel)

options usbhid pb_fnmode=2

After you have pasted in the appropriate entry you may want to restart your machine or try reloading the hid or usbhid kernel module, after which the function behaviour should be corrected.

7 thoughts on “Remapping the Function Key Behavior on MacBook / MacBook Pro

  1. Jason Brower

    I wonder if we can swap the function and cntrl keys. I am getting pains in my hand from not having that cntrl key int he corner… but to the right of the function key. grrr! Thanks for the post.

  2. Pingback: alexsk - blog » Fra OS X til Ubuntu 7.04 (feisty fawn)

  3. joe

    um….. k I have no idea what the f7 key is supposed to do… anyone know?

    AND by the way there is an option in system preferences that flips it automatically…. haha

    then you just set your keys…..

    go to key and mouse in system preferences and just click the little check box……

    then chose you keys….

  4. Theo

    When pommed is installed take also a look at /etc/pommed.conf, general section.

    On my mbp (santa rosa) the modprobe options setting didn’t do the trick… Maybe it is overridden by the pommed settings…

  5. Carl

    Thanks. Your tip worked for Ubuntu Hardy and Intrepid but no longer in Jaunty. The configuration file should now contain the line 'options hid-apple fnmode=2'.

    Also the file should have the .conf extension, /etc/modprobe.d/function.conf.

  6. Brad

    The line in Jaunty should be 'options hid_apple fnmode=2'

  7. Ray

    I find pommed to be the best solution as it also deals with all the other keys. still need to edit /etc/pommed.conf though 🙂


Leave a Reply