You can change the windows system parameters... like so..
SuperStrict
Import pub.win32
Extern "win32"
Function SystemParametersInfo:Int( uiAction:Int, uiParam:Int, pvParam:Int, fWinIni:Int ) = "SystemParametersInfoA@16"
End Extern
Graphics 800,600
Const SPI_GETMOUSESPEED:Int = $70
Const SPI_SETMOUSESPEED:Int = $71
Global currentMouseSpeed:Int
' Store the current mouse speed so we can reset it before closing
SystemParametersInfo( SPI_GETMOUSESPEED, 0, Int Varptr currentMouseSpeed, 0 )
' Change the mouse speed (ranges between 1 and 20)
SystemParametersInfo( SPI_SETMOUSESPEED, 0, 1, 0 )
While Not KeyHit( KEY_ESCAPE )
Cls
DrawText "Sloooooooow mouse. Escape to reset it and end.", 10, 30
Flip
Wend
' Reset the original mouse speed
SystemParametersInfo( SPI_SETMOUSESPEED, 0, currentMouseSpeed, 0 )
Not very nice for the user though.
Your ideal thing to do is to get the current speed of the mouse and then use a multiplier in your own code to force a fixed (and controllable) rate.
|