Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am using Debian 6.0.4. The mouse wheel scrolls way to much for it to be any use. Is there any way to configure how much "scrolling" is done with with one mouse wheel turn? Thanks!

Update: My keyboard and mouse are wireless, connected to a USB port in a KVM which is connected by USB to the computer (and it even works :-) ).

xinput --list output:

⎡Virtual core pointer                       id=2    [master pointer  (3)]
⎜↳ Virtual core XTEST pointer               id=4    [slave  pointer  (2)]
⎜↳ Microsoft Microsoft® 2.4GHz Transceiver v8.0 id=9    [slave  pointer  (2)]
⎜↳ Microsoft Microsoft® 2.4GHz Transceiver v8.0 id=10   [slave  pointer  (2)]
⎜↳ Justcom Technology USB KVM Switch        id=12   [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)] 
↳ Microsoft Microsoft® 2.4GHz Transceiver v8.0  id=8    [slave  keyboard (3)]
↳ Justcom Technology USB KVM Switch         id=11   [slave  keyboard (3)]

xinput --list-props 9 output:

Device 'Microsoft Microsoft® 2.4GHz Transceiver v8.0':
    Device Enabled (128):   1
    Device Accel Profile (254): 0
    Device Accel Constant Deceleration (255):   1.000000
    Device Accel Adaptive Deceleration (257):   1.000000
    Device Accel Velocity Scaling (258):    10.000000
    Evdev Reopen Attempts (246):    10
    Evdev Axis Inversion (259): 0, 0
    Evdev Axes Swap (261):  0
    Axis Labels (262):  "Rel X" (136), "Rel Y" (137), "Rel Misc" (263)
    Button Labels (264):    "Button Left" (129), "Button Middle" (130), "Button Right" (131), "Button Wheel Up" (132), "Button Wheel Down" (133), "Button Horiz Wheel Left" (134), "Button Horiz Wheel Right" (135), "Button Side" (249), "Button Extra" (250), "Button Unknown" (247), "Button Unknown" (247), "Button Unknown" (247), "Button Unknown" (247)
    Evdev Middle Button Emulation (265):    2
    Evdev Middle Button Timeout (266):  50
    Evdev Wheel Emulation (267):    0
    Evdev Wheel Emulation Axes (268):   0, 0, 4, 5
    Evdev Wheel Emulation Inertia (269):    10
    Evdev Wheel Emulation Timeout (270):    200 
    Evdev Wheel Emulation Button (271): 4
    Evdev Drag Lock Buttons (272):  0
share|improve this question

3 Answers 3

You can control the acceleration of the mouse (and scroll wheel) through the commandline program xinput. Use xinput --list to list the input devices. You can then use the ID of your mouse to list its properties like xinput --list-props <ID>. There should be one for the scroll wheel acceleration. You can change it through xinput --set-prop <ID> <propertyID> <value>. You might have to experiment with the values a bit to figure out the right one.

share|improve this answer
    
Thanks for the answer. I found my input device (9) and did xinput test 9. Scrolling up one click on the wheel gives button press 4 16 times, scrolling down one click gives button press 5 16 times. But when I look at xinput list-props 9 there is entry with a value 16. I tried changing Wheel Emulation Inertia but nothing changed. There are no other parameters that seem to be of help (haven't tried others anyhow). Do I have to restart X for the changes to take place? Any other places where I can search? –  vainolo Feb 1 '12 at 15:24
    
You don't need to restart X for the changes to take effect. Could you post the output of xinput --list and xinput --list-props 9 please? –  Lars Kotthoff Feb 1 '12 at 18:02
    
I updated the question with the output –  vainolo Feb 1 '12 at 18:54
    
Hmm, looks like for some people unplugging the mouse and plugging it in again worked. You could also try the same with the KVM switch. –  Lars Kotthoff Feb 1 '12 at 19:08
    
Nothing happened :-( –  vainolo Feb 2 '12 at 7:03

Generally the mouse wheel resolution is determined by the desktop environment you use. Which desktop environment are you using currently?

share|improve this answer
    
I am using Gnome 2.30.2 –  vainolo Jan 30 '12 at 21:37
    
I'm a debian/KDE user for 5+ years and KDE always had it. In gnome it looks like an automatic speed calculator has been added in 2.40. I'm not sure whether the X.org drivers evdev or mouse have this functionality but, I can strongly recommend to moving to testing branch of debian if you're using it as a desktop or personal system and have no special resons to use debian stable. –  SilentStorm Jan 30 '12 at 21:57
    
Thanks... but how would that help? –  vainolo Jan 31 '12 at 7:13
    
Debian testing is a rolling release, running nearly bleeding edge versions of the available software and it's as stable as other distributions. In short, it'll bring you a more modern distro with more features. –  SilentStorm Jan 31 '12 at 11:24

For the following to work, you need programs xte and xbindkeys. For Debian, and most derivatives like Ubuntu, these come in packages xautomation and xbindkeys respectively. Should you use some other distribution, you'll have to just search your package manager to find the correct packages.

The idea behind that follows is that instead of actually accelerating movement of the mouse wheel, we generate multiple button events each time the wheel is scrolled. The way this is done does not save your cpu, as an external program will be run every time we generate multiple button events ie. every time the scroll wheel is rolled. This may be of some consideration, but a hack is a hack.

First you need to get the id of the input device, ie. the mouse, you are using. You'll get this from output of xinput list.

Then you need to get the button map for the device. You'll get this from output of xinput get-button-map <device>.

To find out which buttons map to the scroll wheel, run xinput test <device> and scroll up/down a few times. That will output events from the device specified to the terminal and lets you see which buttons map to the scroll wheel.

For the sake of an example, we'll be using an old Microsoft USB mouse, having two normal buttons and a scroll wheel. Rolling the wheel up maps to button 4 and rolling the wheel down maps to button 5. Luckily the button map for this device has two unused buttons, 6 and 7, so we'll use these.

First we remap buttons 4 and 5 to unused buttons.

xinput set-button-map <devid> 1 2 3 6 7 4 5

This will let us use events for buttons 6 and 7 for wheel events, thus enabling us to do whatever we like when events for those buttons are received. In this case we are going to produce multiple mouse events for a single mouse wheel roll (ie. a click in either direction).

To multiply (accelerate) by three, for example, we'd put the following into ~/.xbindkeysrc:

"/usr/bin/xte 'mouseup 6' 'mouseclick 4' 'mouseclick 4' 'mouseclick 4' &"
b:6 
"/usr/bin/xte 'mouseup 7' 'mouseclick 5' 'mouseclick 5' 'mouseclick 5' &"
b:7 

That in effect binds to release event of button 6 three click events of button 4. Binding that directly to release event of button 4 would produce an infinite loop, because every time button 4 is released, three new events of the same type for the same button are generated. That is why we remapped the buttons earlier.

To test the setup, run xbindkeys -n -v (this will produce verbose output on the console, letting you see what exactly gets produced when you roll the wheel of your mouse. If everything goes fine, this should produce something like this:

user@host:~$ xbindkeys -n -v
displayName = :0
rc file = /home/sjl/.xbindkeysrc
rc guile file = /home/sjl/.xbindkeysrc.scm

min_keycode=8     max_keycode=255 (ie: know keycodes)
"/usr/bin/xte 'mouseup 6' 'mouseclick 4' 'mouseclick 4' 'mouseclick 4' &"
    m:0x0 + b:6   (mouse)
"/usr/bin/xte 'mouseup 7' 'mouseclick 5' 'mouseclick 5' 'mouseclick 5' &"
    m:0x0 + b:7   (mouse)
starting loop...
Button press !
e.xbutton.button=6
e.xbutton.state=0
"/usr/bin/xte 'mouseup 6' 'mouseclick 4' 'mouseclick 4' 'mouseclick 4' &"
    m:0x0 + b:6   (mouse)
got screen 0 for window ae
Start program with fork+exec call
Button release !
e.xbutton.button=6
e.xbutton.state=0
Button press !
e.xbutton.button=7
e.xbutton.state=0
"/usr/bin/xte 'mouseup 7' 'mouseclick 5' 'mouseclick 5' 'mouseclick 5' &"
    m:0x0 + b:7   (mouse)
got screen 0 for window ae
Start program with fork+exec call
Button release !
e.xbutton.button=7
e.xbutton.state=0

If you now move the focus to some scrollable window, Firefox for example, you should see that scrolling with the wheel has become three times as fast as it was.

Now all left to do is to start xbindkeys in the background when you start you X session. That is left as an exercise for the reader.

share|improve this answer
    
Thanks for the thorough explanation. I'll check it out if I install debian again. –  vainolo Aug 11 at 9:51

Your Answer

 
discard

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.