I've been having a lot of trouble getting my Apple Bluetooth Keyboard working in Ubuntu with my D-link DBT-122 usb module.
I followed this guide: HOWTO: Apple Wireless Keyboard (Bluetooth)
I managed to get the computer to find the keyboard but it wouldn't actually connect to it... It turned out to be quite a simple problem though. I didn't have the Bluetooth applet running, so I never got the pop-up window that asks for the key! :)
Quick solution. In one terminal window, run:
and in another window run:
sudo hidd --connect 00:1B:63:F9:A7:B6
(of course, your id number will be diffirent...)
Then type in a 4 digit number on the bluetooth keyboard and the bluetooth-applet should come up with a pop-up asking you to type in the key on the laptops keyboard.
The only thing left is that I can't get the keyboard to automatically reconnect to the computer when the keyboard has suspended itself. I just runn the hidd command again on the laptop (no need for the bluetooth-applet, the computer and keyboard are already paired), and the computer connects to the keyboard.