Skip to content

mirbyte/windows-drag-threshold

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Windows Drag Threshold Tool

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.

Features

  • 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).

Requirements

  • Windows 10 or Windows 11
  • Python 3.8 or later

Installation & Usage

1. Download the Script

  • 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
    

2. Run the Application

You can run the application using either of the following methods:

Method 1: Double-Click (Recommended for Windows)

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.

Method 2: Command Line

If you prefer using the terminal, run:

python drag_threshold.py

How It Works

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.


ui

If you found this project useful, please drop a ⭐ – it means a lot!

About

A lightweight, standalone utility to view and adjust the system-wide mouse drag threshold on Windows.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages