Windows Inertial Mouse Driver
Repository-structured presentation of a KMDF HID mouse filter driver that converts physical mouse movement into acceleration, velocity, and friction-based cursor slowdown.
Abstract
This project implements a Windows HID mouse upper-filter driver that treats incoming relative mouse movement as acceleration instead of direct cursor displacement.
The driver keeps virtual velocity in kernel state, emits continued relative movement through a KMDF timer, and applies friction until the cursor settles. The surrounding repository includes the driver source, registry-backed tuning defaults, build scripts, and a Windows setup wizard for local test installation.
Repository Structure
- src/inertialmouse
- KMDF HID mouse filter driver split into driver entry, filter connection, motion physics, and registry configuration modules.
- src/installer
- .NET 10 WinForms setup wizard for selecting the target mouse, installing the filter, uninstalling it, and disabling test-signing when requested.
- scripts
- PowerShell build, install, uninstall, and toolchain scripts used by both developers and the bundled installer.
Implemented Scope
- Attach as a HID mouse upper-filter through an INF targeted at the selected mouse hardware ID.
- Convert raw relative mouse deltas into persistent X/Y virtual velocity.
- Emit continued motion from a KMDF timer while friction decays the stored velocity.
- Keep button events tied to physical input so clicks are not repeated during inertial motion.
- Package a single-file installer with runtime detection and a traditional Windows wizard flow.
Implementation Surface
Driver Core
driver.cfilter.cfilter.hinertialmouse.h
Motion and Config
motion.cmotion.hconfig.cconfig.h
Installer and Build
InstallerForm.csProgram.csbootstrapper.cppbuild-installer.ps1
Packaging Evidence
The installer is produced as a small native bootstrapper that embeds the managed setup wizard and driver payload. It checks for the .NET 10 Desktop Runtime, offers assisted installation when missing, and keeps PowerShell windows hidden during driver operations.
Figure 1
Single-file installer package
Windows setup wizard for selecting a HID mouse, installing the kernel filter, registering an uninstall entry, and cleaning up test-signing during uninstall.
PS> .\scripts\build-installer.ps1 InertialMouseInstaller -> publish\ bootstrapper.cpp Single-file installer created: dist\InertialMouseInstaller.exe
Safety note
This is a test-signed driver package for local experimentation. Production distribution would require the appropriate Windows driver signing and release process.