On my aluminum Apple Keyboard I prefer to have the F1 – F12 keys operate as the F1 – F12 keys by default, and access the brightness, expose, and other extras in combination with the Fn key. The is the opposite of the way they function in OSX. In OS X, you very rarely ever need to use the F1-F12 key unless you are using some professional software that uses them for shortcuts, so it is not that big of a deal. In Linux, however, I use these keys a lot to switch to virtual consoles and access gnome shortcuts. Previous to Intrepid, it was recommended to install pommed to enable the functions of many of these special keys. pommed’s config file had the option to swap the way the Fn key works, requiring you to use Fn in order to change the brightness, etc. Now, in Intrepid (8.10) most of the functionality of pommed has been implemented into hal and pommed simply creates conflicts. So how do we swap the function of the Fn key?

First edit /etc/modprobe.d/options
sudo nano /etc/modprobe.d/options

and make sure it has the line
options hid pb_fnmode=2

Then save and exit. Lastly, we need to update ramfs:
sudo update-initramfs -u -v -k `uname -r`

Then just reboot!

Tags: , , , , , , , , ,
9 Responses to “Swap Apple Keyboard Function Key Operation in Ubuntu”
  1. SAR says:

    I haev a 13″ Macbook Pro I’ve followed everything here:

    https://help.ubuntu.com/community/MacBookPro5-5/Karmic?highlight=%28%28MacBookPro5-5|Karmic%29%29

    I also have the repo for Nvidia Vdpau Team PPA ( With this repo I installed Nvidia 190 source & glx)

    https://launchpad.net/~nvidia-vdpau/+archive/ppa

    I can’t change my screen brightness with F1 and F2 and F5 and F6 do nothing, I can’t adjust the key lights?

    Will all of this work in Karmic for a 13″ Macbook Pro 5.5?

    THANKS

  2. Chris Lasher says:

    I think /etc/modprobe.d/options is deprecated and should instead be /etc/modprobe.d/options.conf.

  3. Torbjørn Vatn says:

    On Jaunty Jackalope (Ubuntu 9.04) I had to alter the second step to:
    options hid_apple fnmode=2
    Notice that I also removed the pb_ part because I’m using an external slim aluminum keyboard on a Thinkpad. Not sure if that was necessary however.

  4. Ricky says:

    Thanks. Some people just can’t be pleased. Glad this post could help!

  5. …and now that I actually read the blog post, thanks for it, too. I was just going to muck about with Xmodmap. :P

  6. Just wanted to say you wrote a really nice post on the Intrepid fan bug. I’m just another random macbook user and I was sorry to see the snarky response you got. I don’t know why he’s yanking your chain, but you did good and he’s a just a jerk you should ignore.

    (Pardon leaving a comment on a random blog post entry, but I couldn’t find a way to send a message through Launchpad, a comment form on this site, or an email address.)

  7.  
Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>