User Tools

Site Tools


changing_20the_20mouse_20speed

Changing the mouse speed

by Richard Russell, January 2011

You can change the mouse speed, that is how fast the mouse pointer moves when you physically move the mouse, as follows:

        SPI_SETMOUSESPEED = 113
        SYS "SystemParametersInfo", SPI_SETMOUSESPEED, 0, speed%, 0

Where speed% has a value between 1 (slowest) and 20 (fastest). The default value is 10.

The above code changes the speed only for the current session. If you want to change the speed 'permanently' set the final parameter to 1:

        SPI_SETMOUSESPEED = 113
        SYS "SystemParametersInfo", SPI_SETMOUSESPEED, 0, speed%, 1

Note that the mouse is a shared resourse, so any change you make will affect all applications and utilities, not just your program.

You can discover the current mouse speed setting as follows:

        SPI_GETMOUSESPEED = 112
        SYS "SystemParametersInfo", SPI_GETMOUSESPEED, 0, ^speed%, 0

This will set speed% to the current value (note the very important ^ before the variable name).

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
changing_20the_20mouse_20speed.txt · Last modified: 2024/01/05 00:22 by 127.0.0.1