Skip to content

The Logitech MX Air mouse in Linux

Mini review :

So a few weeks ago I went and dropped $160 on a Logit­ech MX Air mouse. I’ve been jus­ti­fy­ing this fairly out­rageous price by telling myself it would be a worth­while addi­tion to my desktop rig, which is look­ing more and more like a media centre every day. Sure, it actu­ally is a worth­while addi­tion, but mostly I think it’s more to do with me being a tra­gic Logit­ech fan­boy (I’ve already got a Logit­ech wire­less key­board and mouse combo at home, another one at work, and a set of X-540 sur­round speak­ers with which I tor­ment my neigh­bours on a reg­u­lar basis).

Turns out gyro­scopic mice are a lot of fun to use. On the desk it works fine, but the odd shape takes a little get­ting used to. Prob­ably the worst thing about it is the lack of a middle but­ton. The scroll wheel has been replaced with a touch-sensitive pad, with but­tons at the top and bot­tom that simply scroll. But it’s a mouse that was really designed to be picked up and waved around. Hold­ing it in the air is very comfortable.

Things that work :

There doesn’t seem to be a lot of people using these mice in Linux yet. All I’ve been able to find to date is a couple of review­ers who plugged it in for five minutes and noticed “basic point­ing func­tions” work­ing. Whatever that means.

I was pleas­antly sur­prised, though, with how well this thing works with Linux. Basic move­ment and scrolling works both on the desk and in the air — the scroll pad accel­er­ates a lot faster than a wheel will, and I’m lov­ing it.

The mouse also has four cus­tom but­tons: two labelled “BACK” and “SEL”, a play/pause but­ton and a volume but­ton. Out of the box, SEL is mapped to but­ton 1 (for select­ing stuff while it’s in the air), and the other two gen­er­ate sens­ible key­codes and work out of the box in Ubuntu (VOL mutes and unmutes the volume). The mouse also has a few built-in ges­tures; hold­ing the volume but­ton and wav­ing the mouse up and down changes the volume, while hold­ing play and wav­ing it in small circles will skip to the pre­vi­ous and next tracks. Again, the con­trol­ler sends back sens­ible key­codes for these, and I didn’t have to do any­thing at all to make these work in Ubuntu.

Things I’ve fixed:

To make the BACK but­ton usable takes a little bit of work. Out of the box it seems to be detec­ted as but­ton 2, but it’s too far out of the way to be ter­ribly usable as a middle but­ton. Ubuntu (and prob­ably most other dis­tri­bu­tions) use a default mouse type of ImPS/2, but the MX seems to fare a little bet­ter with the newer ExplorerPS/2 driver. Addi­tion­ally, not all of the but­tons seem to be detec­ted cor­rectly, so manu­ally set­ting them helps. My mouse device cur­rently looks like:

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
        Option          "CorePointer"
        Option          "Device"        "/dev/input/mice"
        Option          "Protocol"      "ExplorerPS/2"  
        Option          "Buttons"       "20"
        Option          "ZAxisMapping"  "4 5"
        Option          "Emulate3Buttons"       "true"
EndSection

I first tried set­ting the but­tons to 16 (after play­ing around with a USB packet sniffer, see below). On star­tup X would poll the mouse, which repor­ted it had 20 but­tons. So that’s what I set it to. Now xev registers a BACK but­ton press as but­ton 8, and I can’t wait to think of some­thing use­ful to do with it.

Things I haven’t fixed:
The one thing that’s eluded me so far is detect­ing when the mouse is being used in the air. The bundled Win­dows soft­ware does this, chan­ging the pointer to a sex­ier, lar­ger one that can eas­ily be seen from the couch. I’ve been using the trial ver­sion of USB Mon­itor to sniff traffic, mostly because none of the freely avail­able tools were able to decode it enough for poor plebs like me who haven’t read the HID spec. But it was enough to fig­ure out that the mouse seems to be set­ting but­ton 13 on while it’s in the air.

Back in Linux, xev viol­ently dis­agrees. It doesn’t give up any sign of any but­ton events that I’ve seen yet. I’m guess­ing it’s an option that the Win­dows driver is turn­ing on, but haven’t yet looked at any of the traffic that goes on when the device is plugged in.