Bluetooth mouse

This article describes how to setup a bluetooth mouse.

Under Linux, bluetooth is managed by the BlueZ daemon.

This howto documents usage of >=bluez-4, which has been in the stable portage tree for a while now.

Kernel
The kernel configuration needs to be updated to enable the drivers for your bluetooth hardware, and the associated protocols.

Enable HIDP protocol in the kernel:

You will also need a driver for your bluetooth device:

BlueZ
test-programs needs to be added to the use flags.

Start the bluetooth service with:

To make it permanent:

GUI configuration
There are many GUIs to configure bluetooth devices :, , , and probably a few more. Install one and it should not be difficult to add your mouse.

CLI Configuration
Configuration can either be performed using the BlueZ test programs (available if you enable the USE flag for bluez, or by using the D-Bus API. The first way is described here.

The first thing to do is to retrieve the address of the mouse. Most of the devices need you to press a special button, possibly for several seconds, to render them discoverable.

The address looks like 11:22:33:44:55:66.

Then we need to pair the device:

A PIN might be requested, if you don't know the PIN, then it is probably 0000.

Now we mark the device a trusted so it can connect automatically:

And finally we connect the device (this only needs to be done once, it will be done automatically after that):

And that's it, the mouse should work immediately for your current session, and automatically after a reboot.

Bluetooth working (ie. `hcitool dev` lists the device and `hcitool scan` does find devices) but the bluetooth tray icon (from gnome-bluetooth or gnome-shell) just don't show up.
Your user needs access to bluetooth and rfkill. Add the user to the `plugdev` group.