Apple Wireless Keyboard Setup (Ubuntu 7.10)
Saturday, November 17, 2007 at 12:53PM
Last week I purchased a Apple Wireless Keyboard for use with my home theater PC. I had wanted to get a wireless keyboard for a while and the new Apple keyboards are super thin and the wireless one uses Bluetooth, so it has exceptional range. As is sometimes the case with Linux, this device is not as plug and play as we might like. Even though Ubuntu 7.10 (Gutsy) has more built-in Bluetooth utilities than previous versions, it still requires some more advanced setup to get properly synced with the computer. The following tutorial is mostly taken from an Ubuntu Forum Thread, but I have edited it to include some additions from replies to the original thread and for clarity.
Note: the expression XX:XX:XX:XX:XX:XX represents your particular keyboard's device address and it should be inserted wherever else it appears in the tutorial. This tutorial worked for me for the new aluminum style wireless keyboard pictured, I have not tried it with the older style keyboard.
- Install the package bluez-gnome
Code:
user@ubuntu:~$ sudo apt-get install bluetooth bluez-gnome
Restart your desktop session by logging out and logging in again. This will automatically start the bluetooth applet which will help you enter the PIN during the bluetooth pairing process.
- Find out the Bluetooth Hardware Device Address of the Apple Keyboard
Code:
user@ubuntu:~$ hcitool scan
Scanning ...
XX:XX:XX:XX:XX:XX Apple Wireless Keyboard
-
Edit the file /etc/bluetooth/hcid.conf
Code:
user@ubuntu:~$ sudo gedit /etc/bluetooth/hcid.conf
Enter the following stanza at the end of the file:
device XX:XX:XX:XX:XX:XX {
name "Apple Wireless Keyboard";
auth enable;
encrypt enable;
}
Save the file and close gedit.
-
Enable HID-support at start-up:
Code:
user@ubuntu:~$ sudo gedit /etc/default/bluetooth
Change "HIDD_ENABLED=1"
Save the file, close gedit
-
Restart the Bluetooth subsystem
Code:
user@ubuntu:~$ sudo /etc/init.d/bluetooth restart
* Restarting Bluetooth services... [ ok ]
Notice that this will terminate any active bluetooth connections. However, reconnecting should not be a problem
-
Complete the device pairing
Restart the keyboard again using the switch on the side to make it discoverable. Do not hit any keys on your Apple Keyboard unless this tutorial says so. It might cause all sorts of strange trouble during the pairing procedure. Right after restarting the keyboard, run the following command:
Code:
user@ubuntu:~$ sudo hidd --connect XX:XX:XX:XX:XX:XX
Ubuntu will now try to connect to the keyboard without showing any progress bar or other output. Enter the PIN 0000 and hit the enter key (both on your Apple Keyboard). Right after hitting enter, a notification window should pop up on your desktop asking you for the PIN you just entered. Enter it. "hidd" should finish without further outputs. You should now be set up.
Ubuntu 8.10 contains an improved Bluetooth application that can connect to the Apple Wireless Keyboard without issue. The previous setup procedure is only necessary if you are running an older version of Ubuntu.
Joe |
4 Comments | 
Reader Comments (4)
I've looked at many how-to guides for pairing an Apple wireless keyboard in Ubuntu but I always get stopped at the PIN stage of the process. I own the older white plastic wireless model and I am running eeeXubuntu (7.3) on an eeePC. I have a Microsoft bluetooth mouse that pairs and auto-reconnects flawlessly so I know this problem is isolated to the keyboard.
I turn the keyboard on, hit enter on the Ubuntu side to run "sudo hidd --connect..." and I get nothing. I enter a 4-number code on the apple keyboard and press enter.
Nothing. No prompt, just an eventual timeout with the message "Can't get device information: Function not implemented"
Is there something I have overlooked?
-Craig
Craig,
The only suggestion I can make is that for some reason I had to use the PIN 0000 for the pairing to work. I don't know why, but this was the only way to complete the pairing.
Thank You very much for this one! I read a lot of about this keyboard, but as I remember the Fn key can't be used with Ubuntu (the wired version works, but not the wireless) - so You can't use Page Down (Fn + down arrow), Volume Up (Fn + F12), etc. Is this problem fixed in Ubuntu 7.10? Can You use the multimedia functions?
Thanks for the answer!
Well, I tried other four-number combinations and eventually tried your 0000 suggestion and received the same error message. I'm not giving up yet. Thank you for your help, Joe!
-Craig