A lightweight, standalone utility to view and adjust the system-wide mouse drag threshold on Windows.
The drag threshold defines how many pixels the pointer must move after a mouse-down event before the operating system treats the action as a drag rather than a click. Increasing this value helps prevent accidental drag-and-drop operations.
- Linked or Independent Axes – Adjust width and height together, or unlink them to set different pixel thresholds for each axis.
- Safe State Handling – Validates every change and automatically rolls back to the previous values if a system update fails.
- Zero Dependencies – Built entirely with the Python standard library (
tkinter+ctypes).
- Windows 10 or Windows 11
- Python 3.8 or later
-
Option A (Download ZIP): Download this repository as a ZIP file, extract it, and locate
drag_threshold.py. -
Option B (Git Clone): Clone the repository via your terminal:
git clone https://github.com/mirbyte/windows-drag-threshold.git cd windows-drag-threshold
You can run the application using either of the following methods:
Simply double-click the drag_threshold.py file to launch the interface.
Tip
Hide the Console Window: Rename the file from drag_threshold.py to drag_threshold.pyw. Windows associates the .pyw extension with pythonw.exe, which launches the GUI instantly without opening a blank command prompt window in the background.
If you prefer using the terminal, run:
python drag_threshold.py
The tool communicates directly with the Windows UI subsystem via ctypes. It calls GetSystemMetrics to read the current threshold and SystemParametersInfoW with the SPI_SETDRAGWIDTH / SPI_SETDRAGHEIGHT actions to apply changes. Updates are committed using the SPIF_UPDATEINIFILE and SPIF_SENDCHANGE flags, which make the new settings persistent across sessions and broadcast the change immediately to all running top-level windows.
If you found this project useful, please drop a ⭐ – it means a lot!