Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

ive got problem with broken scroll wheel. (I know i shoud change mouse, its old). And i want to just disable wheel scroll but not middle button click.

I know that it is possible to do, but cant find that config file. (have no entry at xorg.conf)

share|improve this question

migrated from Aug 29 '11 at 14:13

This question came from our site for system and network administrators.

up vote 11 down vote accepted

Ive found out how to configure that. Open terminal window:

xinput list 

find there yours mouse id number

↳ A4Tech PS/2+USB Mouse id=8 [slave pointer (2)]

ive got ID=8


xinput list 8

You ll see there

Button labels: Button Left Button Middle Button Right Button Wheel Up Button Wheel Down Button Horiz Wheel Left Button Horiz Wheel Right Button Side Button Extra Button Forward Button Back Button Task Button Unknown Button Unknown Button Unknown Button Unknown

they are counted by numbers 1,2,3,4,5,6,7 ...

now do that:

xinput get-button-map 8

you will got something like that

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

numbers 4 and 5 are for "mouse wheel up scroll" and "mouse wheel down scroll"

now we will disable them with zero number:

xinput set-button-map 8 1 2 3 0 0 

thats all.

share|improve this answer
Nicely done, and I learned some things from your answer. But an easier way of identifying the buttons (works for scrollwheel too) described here: – Lambart Sep 19 '14 at 18:52
In short, assuming buttons 4 and 5 are the scroll wheel (they are for me, too), just put this line in a file called .Xmodmap in your home directory: pointer = 1 2 3 0 0 6 7 8 9 (note that I think this will disable any buttons beyond 9--add more numbers if needed) – Lambart Sep 19 '14 at 18:54
Works fine in elementary s.o. Thanks man!! – JRichardsz May 30 at 0:57

It looks like you can do that with the output from HAL and xev, then updating your xorg.conf.


They basically create a stanza for the mouse definition in the xorg.conf.d directory and null the wheel (which in my experience is usually button ID 5). Careful when following those instructions as it is also for disabling left and right click as well.

share|improve this answer
You say the wheel is button 5 but isn't it usually represented by two buttons (up and down)? – Alexandre Jasmin Aug 30 '11 at 4:48
11.04 doesnt have hal, so i dont know now for sure what to do to "find out the name of your device". name from lshw or lsusb shoud work or not? – MealstroM Aug 30 '11 at 10:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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