As I mentioned in a previous post, I love the feel of the Apple Keyboard. It’s comfortable, fast, reliable, and looks great to boot.
[EDIT, 2010-07-07: I recommend you check out this page no matter what version of Ubuntu you are on at this point. It has information for most setups.]
There is a fly in the ointment, however, for Hardy Heron, Intrepid Ibex [and now Jaunty Jackelope] users: The prime real estate of the function keys is unavailable without the finger-pain-inducing <fn> + <FUNCTION> key combo. Changes designed to improve functionality for Apple MacBook keyboard users introduced this bug. This was quite frustrating. I had those keys mapped to all sorts of useful life-changing functions.
There is a solution!
[Hardy and Intrepid users:]
Edit /etc/modprobe.d/options, add “options hid pb_fnmode=2″. Then run
1 | sudo update-initramfs -u |
[Thanks to Marco for the following!]
Or if you are running more than one kernel:
1 | sudo update-initramfs -u -k all |
Then reboot. After things are back up, the function keys will act as normal, no more pressing <fn>!
For Jaunty Jackelope (9.10) users:
As it turns out, this bug didn’t get fixed for 9.10. What’s worse: the old fix doesn’t work now! Here’s what you need to do to get the function keys as well as the numpad working.
Numpad
- Select System -> Preferences -> Keyboard
- Go to Layouts
- Click “Layout Options” button
- Under “Miscellaneous compatibility options”, select “Default numeric keypad keys” and “Numeric keypad keys work as with Mac”
Now you have a numpad back!
Function keys
I found a comment on this page that said the fix for the function keys was:
- Edit /etc/rc.local
- Add:
1echo 2 > /sys/module/hid/parameters/pb_fnmode
- Reboot
This couldn’t work for me, as the directories from hid down didn’t exist on my system. Instead I did:
- Edit /etc/rc.local
- Add:
1echo 2 > /sys/module/hid_apple/parameters/fnmode
before “exit 0″
- Reboot
Then the function keys worked as normal! [EDIT, 2010-07-07: I realized more later that "normal" was a little too optimistic. For an explanation of what the 2 means in the command above, as well as how to change the behavior easily, see this page.]
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.









Oh! it is great. I was searching for this information from last 3 days.
Really thanks for the information.
I have an apple wired aluminium keyboard the small version and the function keys seem to act normal with Ubuntu 8.04, it was simply plug and play ie I don’t need to press fn Fxx to access the function. The control, command (alt) keys are normal. However,I would like the command/option keys to function like they would on a mac. eg command-left arrow = move cursor to beginning of line, etc.
@Zac: Might be a difference between the large and small models. I didn’t have the problem with the larger one once I upgraded to Jaunty.
As to your other point, I didn’t look for that functionality, since I’m not very familiar with the Mac platform. But that does sound like a useful shortcut, so if you get it working, please share!
Great work! This bug has been moving all over the place with previous fixes never working in the newer version! You can add this solution to this bug (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/201711) on the Ubuntu launch pad.
@sanj Glad it helped you! I’ve posted the fix to the Launchpad bug, thanks for the suggestion.
Linux rules and I’m getting rid of my Mac G5 but I’m joined at the hip to my Mac keyboard.
It makes my head hurt to contemplate the vast depths of knowledge that enabled you to know how to figure out this fix but I’m delighted to find that it works!
Thanks Samuel.
@Alan Actually, I can’t take any credit for it. I ran into the issue, Googled a bit, and found a reliable solution. Thanks must go to the actual arcane wizards who documented the fix.
Hi, i patched kernel with http://lkml.indiana.edu/hypermail/linux/kernel/0903.0/01675.html
and then i found this http://lkml.org/lkml/2009/4/28/287 i hope i get my new a1242 mini keyboard to rock and roll.
It worked, now my mini keyboard works.
Hello,
you lucky people! I wish I understood what to do with the above information!
I would like to get round the use of the key. Would anyone take the time to explain how to do this to a (competent) noob? Or is there a piece of software that could do it?
Thanks in advance,
Alex
@Alex What problems are you having? What version of Ubuntu are you running? If you are on Hardy, Intrepid, or Jaunty (latest three) then the above instructions should serve you well.
Hello Samuel,
I’m on Mac 10.4.11. I guess the above advice will not be appropriate to me?
Thanks anyway
Alex
@Alex Yeah, not exactly
As far as I’ve heard, the keyboard works fine on Macs, as that is what it was designed for.
@Samuel, turns out its done in the preferences>keyboard and mouse… Told you I was a noob!
Thanks for your help anyway.
Toodles
Alex
Samuel … just wanted to say thanks for writing this up.
The second of the options — hid_apple — works perfectly on Ubuntu Karmic.
The last option worked for me (adding echo 2 > /sys/module/hid_apple/parameters/fnmode to /etc/rc.local). Now my aluminum keyboard is working perfectly.
Thanks!
[..] A bit unrelated, but I absolutely liked this blog post [..]
Thanks so much for posting this.
Nice! thanks for the post
Good info.
Remember if you boot more than one kernel (for example if you have the RT kernels from ubuntustudio and the stock kernels from ubuntu) to actually update every initramfs.
@Marco Thanks very much! I’ve updated the post with your tip.