So I tried looking through the various other questions but they mostly focus on disabling the middle mouse paste.

Basically the middle mouse button on my Logitech G500s is broken, and it keeps "clicking" randomly so it's screwing up any chance of doing work.

Is there any way to disable it? Or map it to nothing?

Thanks and sorry if this is a duplicate.

xinput list output:

⎡ Virtual core pointer id=2 [master pointer (3)]
⎜   ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜   ↳ Turtle Beach Turtle Beach PX3 (XBOX) id=8 [slave pointer (2)]
⎜   ↳ Logitech G500s Laser Gaming Mouse id=9 [slave pointer (2)]
⎜   ↳ Logitech G500s Laser Gaming Mouse id=10 [slave pointer (2)]
⎜   ↳ Razer Razer DeathStalker id=12 [slave pointer (2)]
⎜   ↳ Razer Razer DeathStalker 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)]
    ↳ Power Button id=7 [slave keyboard (3)]
    ↳ Razer Razer DeathStalker id=11 [slave keyboard (3)]
  • Execute this command xinput list | grep 'id=' and post the output. – Helio Mar 15 '15 at 13:36
  • For this mouse, there are two device ID's for this mouse. After running xinput test 9, the id of my mouse middle button is 2 – Tom Hamilton Stubber Mar 15 '15 at 13:42
up vote 15 down vote accepted

Execute those commands:

xinput set-button-map 9 1 0 3
xinput set-button-map 10 1 0 3

Explaination (kindly donated by @Yehosef):

The first number is the id of the pointer (you'll often only have one, in this case there were two, 9 and 10).

The next numbers are what you do with the first, second, and third (ie, left, middle, right) mouse buttons. The "1 0 3" tells it that the left button should do a left click (action 1), the middle button should do nothing, and the right button should do a right click (action 3). If you want to make the middle button also do a left click you could use "1 1 3". If you wanted to switch the right and left actions you could use "3 0 1". See https://wiki.ubuntu.com/X/Config/Input for more info.

  • Thanks a lot, trying to look this up was getting very frustrating. – Tom Hamilton Stubber Mar 15 '15 at 13:46
  • 1
    Thanks! For those wondering - the 9/10 are the input id of the mouse and the 1 0 3 are the mappings for the first, second, and third mouse buttons. If you wanted all buttons to do the same thing you could use 1 1 1 or if you want to switch the right and left buttons you could use 3 0 1. – Yehosef Jul 26 '16 at 8:03
  • @Yehosef: Thanks! I did not explain what is happening when the OP ran the commands. Please create a new detailed answer, ping me and I'll upvote. This is an interesting explaination. – Helio Jul 26 '16 at 20:13
  • @Helio I don't have a different answer - just more explanation for those interested. Perhaps you want to edit your answer to include this info you can. I was thinking about editing your answer - but I generally don't like it when people add extra details to my answers - so I refrained :) – Yehosef Jul 27 '16 at 11:15
  • @Yehosef: Feel free to edit my answer. However, would be great if you create a new answer instead. Even if it will not be accepted, it will be the better one. Another thing I could do is set mine as community Wiki. – Helio Jul 27 '16 at 15:12

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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