Inspired by an article by Raymond Chen about how to correctly change the Windows mouse drag sensitivity, I wrote a quick utility called dragsens. It’s a small command-line utility that will allow you to change the number of pixels the mouse has to travel before a drag operation is initiated. Just download and unzip the utility, then run it at the command line, supplying a single parameter that is the number of pixels for the mouse to travel.
If you’d like modify the utility, or examine its source, you may download the Visual Studio 2008 project. If you just want the utility itself, you may download a ZIP of the executable.
About the Utility
The utility is actually very simple. It accepts a single parameter, which is the number of pixels the mouse must travel with a button depressed before the motion registers as a drag action. Rather than separate out the width and height, I just set both to the same number since this is generally all that’s necessary.
BOOL success = FALSE; success = SystemParametersInfo(SPI_SETDRAGWIDTH, numPixels, NULL, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE); if (!success) { DWORD error = GetLastError(); std::wcout < < L"Error " << std::hex << error << std::dec << " while setting drag width." << std::endl; return 1; } success = SystemParametersInfo(SPI_SETDRAGHEIGHT, numPixels, NULL, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE); if (!success) { DWORD error = GetLastError(); std::wcout << L"Error " << std::hex << error << std::dec << " while setting drag height." << std::endl; return 1; }
It would be fairly simple to modify the application to set the width and height independently, if you so desired.
Update
I’m already at version 1.1. I decided to add a version resource and support for a “/?” parameter.
Update 2
I’ve now updated to version 1.2, which adds /X and /Y parameters to allow for changing the horizontal and vertical axes independently.
Share