Slim Aluminum Apple Keyboard with Ubuntu Hardy Heron

Date April 30, 2008

Apple Slim Aluminum Keyboard

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.

  1. Select System > Preferences > Keyboard
  2. Go to the Layouts tab
  3. Click Layout Options…
  4. 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.

21 Responses to “Slim Aluminum Apple Keyboard with Ubuntu Hardy Heron”

  1. Nicolas Wu said:

    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.

  2. matthijs said:

    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.

  3. Jinxware said:

    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!

  4. Ein neues Blatt » Blog Archive » Hello, my name is Lee, and I’m a Ubuntu user… said:

    [...] The solution is here! [...]

  5. n3tfury said:

    F6!!!! you just saved me from snapping this k/b in half, thanks!

  6. jeff said:

    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.

  7. nck said:

    my equal sign does not work, anyone else have this problem?

  8. Ian said:

    Fantastic :)

  9. hzhbest said:

    Finally!! Thank you very much!! This problem almost devastated me.

  10. EyesOfARaven said:

    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!

  11. Petri said:

    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. :)

  12. Carsten said:

    You made my day!! I even thought of deinstalling Ubuntu. Thanks a ton!

  13. Ken said:

    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!

  14. Alan said:

    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.

  15. Bruno said:

    Great! Its work for the numpad and functions key by allan.
    But im from brazil and i cant using ~ ç á correctly =/

  16. Brian K. White said:

    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` -u

    OR

    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

  17. Fixing the function keys on the Apple Keyboard in Ubuntu | tail -f findings.out said:

    [...] found a comment on this page that said the fix for the function keys [...]

  18. Linus said:

    This doesn’t seem to work with the mini keyboard. :(

  19. kevin said:

    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/

  20. Victor Wibisono said:

    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! :)

  21. snio said:

    http://www.hlcsuperstore.com/computers_laptop-parts_laptop-

    keyboards.html