Slim Aluminum Apple Keyboard with Ubuntu Hardy Heron
April 30, 2008
I use the new Apple Slim USB Keyboard with my linux box because I love the way it feels. The new version of Ubuntu isn’t as fond of it as I am.
Number Pad
If you press the ‘clear’ button on the Apple keyboard, it functions as the NumLock button would on a regular PC keyboard. It turns NumLock on, but then part of the alpha portion of the keyboard works like the number pad — as it would on a compact laptop or PowerBook keyboard. Once engaged, pressing ‘clear’ again does not switch it off! Since Gnome stores the state of NumLock between sessions, rebooting doesn’t help. You’re able to log in, but once your session is loaded, NumLock is turned right back on.
If it’s stuck in the on position, you can tap the F6 key twice to turn it back off — when the layout is changed by the ‘clear’ key, F6 becomes the new NumLock. It does this because it assumes you are using a PowerBook style keyboard with no dedicated number pad. This is a kernel bug introduced by a recent patch to the Mac keyboard driver.
To get your number pad working normally, you can set a couple of compatibility options.
- Select System > Preferences > Keyboard
- Go to the Layouts tab
- Click Layout Options…
- Under Miscellaneous compatibility options, select both Default numeric keypad keys and Numeric keypad keys work as with Mac
Unfortunately, ‘clear’ will still cause the funky behavior described above. Until this bug is patched, just remember you can tap F6 twice if NumLock is stuck on.
Function Keys
Another issue is that the function keys no longer work normally. With Ubuntu Gutsy, you were able to use the function keys just like a PC keyboard. With the newer kernel, you need to hold the ‘fn’ key and then hit the desired function key.
The NumLock / keypad bug is logged here on launchpad, as well as a lengthy discussion about this particular keyboard’s issues with Ubuntu at this time. Check it out for more details and geekery.

Posted in
content rss
May 17th, 2008 at 3:29 pm
Ah, thanks so much for this posting. That F6-F6 trick was exactly what I was looking for. It was so frustrating being stuck in gnome without a keyboard – I was switching in and out of userspace with my mouse, and loading fluxbox up to find out what was wrong. What a pain. I can’t understand why a monkey has been put in charge of the ubuntu kernel config for this keyboard.
May 27th, 2008 at 7:29 pm
Thanks so much for the info, this was a lifesaver. Do you have any idea which key is the printscreen key? Thanks a lot in advance.
June 6th, 2008 at 11:53 am
Great tips, thank you for the insight as this issue has pissed me off since last night
it’s a shame they dont have the Fn feature reversed option as in OSX yet, and i couldn’t seem to use pb_fnmode to change it as the file does not exist for /sys/module/hidusb/parameters/pb_fnmode so hopefully they will resolve it soon as having the F keys defaulted is quite essential imho!
June 20th, 2008 at 7:13 am
[...] The solution is here! [...]
June 28th, 2008 at 7:13 am
F6!!!! you just saved me from snapping this k/b in half, thanks!
July 24th, 2008 at 6:49 pm
Thanks dude, I started reading the thread in the support site and was getting worried this wasn’t going to end well. I did one more google search and found your page. Kudos.
July 31st, 2008 at 3:37 pm
my equal sign does not work, anyone else have this problem?
August 2nd, 2008 at 11:21 pm
Fantastic
August 6th, 2008 at 4:17 am
Finally!! Thank you very much!! This problem almost devastated me.
August 24th, 2008 at 9:45 am
My equals works fine. TYVM site owner for posting this, as I thot I permanently borked my shiny new keyboard. I entered that mode and thot it was over!
September 13th, 2008 at 10:14 am
Your numlock-tip really saved my day! I was almost destroying that little aluminium piece of **** because of that numlock I couldn’t switch off.
October 8th, 2008 at 1:08 pm
You made my day!! I even thought of deinstalling Ubuntu. Thanks a ton!
October 17th, 2008 at 11:20 am
THANK you!!! My keyboard was working just great until I pressed the “clear” key and then no more. I tested the keyboard on another computer and it worked just find so I knew it had to be a system thing. I would have never figured this one out. Thanks!
February 8th, 2009 at 4:26 pm
I also have one of these keyboards and managed to reverse the Fn key to allow the F1 – F12 buttons to act normally. I simply added the following line to my /etc/rc.local and rebooted.
echo 2 > /sys/module/hid/parameters/pb_fnmode
Now this keyboard is nearly perfect under Ubuntu Intrepid Ibex.
Al.
March 11th, 2009 at 4:57 am
Great! Its work for the numpad and functions key by allan.
But im from brazil and i cant using ~ ç á correctly =/
March 15th, 2009 at 9:24 pm
For Jaunty the names of things changed a little.
You can have both old & new forms in your config so that it will work on whatever kernel you are booting. There are (at least) 2 possible places to edit, whichever you like.
The modprobe way is cleaner & more organized, but the sysfs way doesn’t require rebuilding initramfs.
The modprobe.d way:
create a file /etc/modprobe.d/hid_apple.conf
add these lines:
# Set default mode for Fn keys on Apple keyboard.
# see also/instead: /etc/sysfs.conf
# valid values 1 or 2. effect is hardware dependant.
# intrepid or earlier:
options hid pb_fnmode=2
# jaunty:
options hid_apple fnmode=2
then update initramfs:
update-initramfs -k `uname -r` -uOR
sysfs way:
edit /etc/sysfs.conf
add these lines:
# Fix default Fn key behavior on Apple keyboards.
# see also/instead: /etc/modprobe.d/hid_apple.conf
# valid values 1 or 2. effect is hardware dependant.
# this version is for Intrepid or earlier
module/hid/parameters/pb_fnmode = 2
# this version is for Jaunty
module/hid_apple/parameters/fnmode = 2
April 29th, 2009 at 7:39 pm
[...] found a comment on this page that said the fix for the function keys [...]
June 25th, 2009 at 1:45 am
This doesn’t seem to work with the mini keyboard.
August 10th, 2009 at 3:37 am
Nice,
here is another piece of info i found useful given that the “” key was in the wrong place : http://www.e-tip.net/blog/2009/04/28/apple-aluminium-slim-usb-keyboard-ubuntu-904-and-incorrectly-swapped-keys/
August 26th, 2009 at 12:47 am
I’ve had the some problem with my function keys of my mac keyboard on Kubuntu. But this website helped me to fix it. Here’s the website: http://dancingpenguinsoflight.com/2009/01/fixing-the-function-keys-on-the-apple-keyboard-in-ubuntu/
Hope it’s useful!
October 10th, 2009 at 3:26 am
http://www.hlcsuperstore.com/computers_laptop-parts_laptop-
keyboards.html