4

I have a program which needs control of a mouse. I have a specific mouse attached for this, and I would like X to leave it alone. Unfortunately whatever mechanism in X autodetects and configures input devices, it is overriding any settings I make in Xorg.conf.

I know this because:

  • I have disabled "AutoEnableDevices" in Xorg.conf, and this stops it from interfering with my mouse. Unfortunately this is not a solution as it also stops it from correctly configuring my other mouse and keyboard, as a result buttons on both devices do not work correctly. (I know this is because my manual configuration of these devices in Xorg.conf is wrong, but I don't know how to fix it and can't find any helpful documentation.)

  • The second mouse has its own entry in Xorg.conf, along with /input/mice, and both have the driver set to void. Also, when I made a mistake configuring the first mouse it still worked when AutoEnableDevices was set.

How do I stop X using the second mouse?

(I have tried disabling the device using xinput, but it always ends up re-enabled after a minute or so. This may be because I am changing permissions so my program can access it without su privileges, but again I need to do that and would prefer a more stable solution than not touching it in the hope that udev forgets its there...)

2

Try something like this in xorg.conf:

Section "InputClass"
  Identifier "My second mouse"
  MatchProduct "MouseModelName"
  MatchIsPointer "on"
  Option "Ignore" "on"
EndSection

MouseModelName can be obtained via xinput.

  • 1
    Thank you. I also found the reason my original attempt didn't work was because I was matching on 'mouseX', but the mouse also created an 'eventX' which was not being ignored. When both are added to MatchDevice, it ignores it. This answer is far better though as the mouse/event numbers change on reboot. – sebf Aug 24 '14 at 12:08

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.