I recently bought a nice little bluetooth keyboard. Being bluetooth based and supporting the standard hid protocol, I didn't expect any trouble at all.
But I was wrong.
After charging the keyboard and putting it in pairing mode, I tried hidtool scan - but it didn't find it. I checked my other bluetooth devices, and they were found - but they also found the keyboard.
Long story short: Turns out it was a bluez bug - thanks to Pacho Ramos for the hint.
As all howtos and so on only cover some GUI frontends for Gnome and KDE, as well as the old (and deprecated) hidd, it wasn't that trivial to get the keyboard to work even after it was finally discovered by hcitool.
jhe in #bluez-users on freenode gave me a brief description on how to do pairing without all the stuff mentioned above:
- Install bluez with USE="test-programs" set
- Set the device to pairing mode
- Use hcitool scan to get the device address
- Run simple-agent hci0 $(hid device address)
- Enter PIN on both sides, PC first, Keyboard second
- Run bluez-test-input connect $(hid device address)
After that it works fine.
Using a frontend might be more viable though, seems the bluez distribution is not supposed to include the necessary tools, the test-programs are only optional.