(updated )

Dragsens – Console-based Drag Sensitivity Utility

Inspired by an article by Raymond Chen about how to correctly change the Windows mouse drag sensitivity, I wrote a simple 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.

Providing a single numeric parameter specifies the number of pixels for the mouse to travel.

dragsens 4

To specify a different number of pixels for the X (horizontal) and Y (vertical) axes, use the /X and /Y parameters.

dragsens /X 10 /Y 12

Entering dragsens or dragsens /? on the command line will display the following help text:

Changes the default drag sensitivity.

DRAGSENS [pixels] [/X pixels] [/Y pixels] [/D]

  pixels  The number of pixels the mouse must travel to initiate
          a drag operation. Providing just a number will change both
          the X axis and the Y axis to the same value.

  /X      Change the setting for the X axis (horizontal).

  /Y      Change the setting for the Y axis (vertical).

  /D      Display the current drag sensitivity settings.

Version 1.5
Paul M. Parks
paul@parkscomputing.com

You may download the version 1.5 executable from GitHub:

https://github.com/paulmooreparks/DragSens/releases

If you'd like to examine or modify the source code or build your own executable rather than relying on the executable above, you may download the Visual Studio 2015 project and source from GitHub:

https://github.com/paulmooreparks/DragSens/tree/master

Please let me know if you encounter any problems or have any questions.

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.

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;
}

License

There isn't one, really. Dragsens is completely free to download, use, modify, and distribute. Dragsens is provided as-is, without warranty and without support.

Change Log

Version 1.5

Moved source to GitHub and updated solution to Visual Studio 2015.

Version 1.4

Add /D parameter to display new and updated sensitivity settings.

Version 1.3

Fixed so that the utility will once again run on Windows XP.

Version 1.2

Adds /X and /Y parameters to allow for changing the horizontal and vertical axes independently.

Version 1.1

Version resource and support for a "/?" parameter.