I am trying to edit my evdev configuration to emulate middle mouse button with both clicking both left and right mouse button simultaneously. This is what I appended to /etc/X11/xorg.conf.d/10-evdev.conf and then I restarted my machine. But it does not work. Can you see what I do wrong?

Section "InputClass"
    Identifier "Logitech Mouse"
    MatchProduct "USB-PS/2 Optical Mouse"
    MatchVendor "Logitech"
    Option "Evdev Middle Button Emulation" "true"

This is the output of xinput list:

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Logitech USB-PS/2 Optical Mouse           id=9    [slave  pointer  (2)]
⎜   ↳ AKKO AKKO 3084BT                          id=11   [slave  pointer  (2)]
⎜   ↳ PS/2 Generic Mouse                        id=14   [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=15   [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)]
    ↳ AKKO AKKO 3084BT                          id=10   [slave  keyboard (3)]
    ↳ HP HD Webcam [Fixed]                      id=12   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=13   [slave  keyboard (3)]
    ↳ HP Wireless hotkeys                       id=16   [slave  keyboard (3)]
    ↳ HP WMI hotkeys                            id=17   [slave  keyboard (3)]
    ↳ ACPI Virtual Keyboard Device              id=18   [slave  keyboard (3)]
  • Just to be sure: You are using X-server and not Wayland, are you?
    – kanehekili
    Jun 27 '20 at 20:23
  • Yes, also sudo xinput set-prop 9 "Evdev Middle Button Emulation" 1 will do what I want to achieve, but I don't want to run that manually every time I start-up. Jun 27 '20 at 20:34

Your approach to configure it via xorg.conf.d is absolute correct. I am not sure about my solution, but it may be worth a try:

Identifier "evdev pointer catchall"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"

Add/replace in your "Input class" section the code above. (Change Identifier, add the rest) Logitech can sometimes be a little different, but I had success with a problem using these parameters.

Does your Xorg.log.0 give any clues about your script ?

If everything fails you may create an systemd service that executes your command: (This is not a solution, but a workaround):

Description="Middle mouse emulation

ExecStart= xinput set-prop 9 "Evdev Middle Button Emulation" 1


Enable the service and it should run the next time you start...

  • Well, the id is not always 9, so it is not that simple. Jun 27 '20 at 21:38
  • Xorg.log.0 gives evdev: Logitech USB-PS/2 Optical Mouse: Unable to query fd: Inappropriate ioctl for device Jun 27 '20 at 21:38
  • 1
    What happens if you change the conf file? You'll tell X to look somewhere else... As I said: it's a workaround (and not a very good one obviously ;-) See here for an ancient problem.
    – kanehekili
    Jun 27 '20 at 21:51
  • That's not the problem. The conf file already existed. I just added my portion to it. Jun 27 '20 at 21:56
  • You wrote Identifier "Logitech Mouse" and I suggested Identifier "evdev pointer catchall". Does it affect your problem?
    – kanehekili
    Jun 27 '20 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.