Tag Archives: xorg.conf

Logitech K400r and the missing middle mouse button

Recently I bought me a new wireless keyboard. Reason was the advice of my physiotherapist to improve my sitting posture at work, so she told me to place the monitor in eye level and the keyboard and mouse near the edge of the desk. But this is not really easy with a notebook. Therefore I searched for a lightweight keyboard with an integrated touchpad: Logitech K400r won the selection.
The keyboard is small so I need to getting used to it but it worked out of the box even on my new installed linux arch distribution. Only one thing was annoying: the missing middle mouse button. I need this little helper so much on a linux system, think only about the handy copy&paste function …

After asking google for help I was a little bit disappointed, because “neojam” [1] wasn’t able to activate/find a way to use the middle mouse button. But I was willing to find a way.

First of all I thought about the possibility to map keys with xmodmap. So I started xev to realize the proper code for the middle mouse button. This approach led to nowhere, because clicking both mouse buttons on my laptop was indicated as “button2” but not on the K400r, there I got only “button1” and “button3”. So I searched for a possibility to map the simultanouse clicking of both buttons. I found the hint to use the “Emulate3Buttons”-Option in the xorg.conf. The default set of this configuration is disabled, but I didn’t want to enable it for the generic mouse InputDevice. This site [2] helped me to remember the “MatchProduct”-Option for special configuration of InputClasses in the xorg.conf. With the xinput list command I got this output:

$ xinput list
⎡ Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                  id=10    [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                       id=11    [slave  pointer  (2)]
⎜   ↳ Logitech Unifying Device. Wireless PID:4024    id=13    [slave  pointer  (2)]
⎣ Virtual core keyboard                       id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard                 id=5    [slave  keyboard (3)]
    ↳ Power Button                                id=6    [slave  keyboard (3)]
    ↳ Video Bus                                   id=7    [slave  keyboard (3)]
    ↳ Sleep Button                                id=8    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard                id=9    [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                      id=12    [slave  keyboard (3)]

So I only had to add this stuff to my xorg.conf:

Section "InputClass"
    Identifier      "Logitech K400r"
    MatchProduct    "Logitech Unifying Device. Wireless PID:4024"
    Option          "Emulate3Buttons" "yes"

And finally my precious middle mouse button worked also on my new keyboard 😎

[1] http://forums.logitech.com/t5/Keyboards-and-Keyboard-Mice/Disappointed-with-my-new-K400r-keyboard/td-p/948530
[2] https://wiki.archlinux.org/index.php/Xorg