Search This Blog

Sunday, February 10, 2013

How to automatically adjust mouse wheel scrolling in windows

My old mouse got broken and and I've bought a new mouse to replace it. The hardware works fine the only problem is that every time when I restart my windows its get a random value of the "Roll the wheel one notch to scroll" value. You can imagine that when the values have 30 a single wheel notch scrolls 30 lines of text in my browser what makes it very annoying.


Problem

How to change the value of "Roll the wheel one notch to scroll" on windows start to lower value.

Analisis and solution description

We are going to use autoit tools[1] that provide automation features for Windows and allow us to modify the registry after system boot. This is the parameter that controls mouse wheel[2]:
 
HKEY_CURRENT_USER\Control Panel\Desktop\WheelScrollLines

A script that sets the registry variable to a new value can be found here: https://github.com/rtomaszewski/tools/blob/master/wheel-scroling.au3


To run it from command line please execute this command and check on Control Panel if the right value has changed:
 
"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" wheel-scroling.au3

The last thing is to create a *.bat script and add it to logon/startup list to be run after user login[3]:
  • Run the gpedit.msc 
  • Navigate to the User Configuration > Windows Settings > Scripts(Log on/Log off) option.
  • Add your *.bat script
References
  1. http://www.autoitscript.com/site/
  2. http://www.autoitscript.com/forum/topic/69061-need-help-with-script/
  3. http://www.addictivetips.com/windows-tips/how-to-run-programs-automatically-on-windows-7-system-startup/


1 comment:

  1. Thank you ! You solved a big problem for me :)

    ReplyDelete