Skip to content

MouseDrive, a Windows utility that maps mouse movement and button events onto a virtual joystick exposed by the vJoy driver. The goal is to give racing simulators and other titles that only recognise joystick input a way to interpret mouse steering, throttle, and braking.

License

Notifications You must be signed in to change notification settings

Toxpox/MouseDrive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

MouseDrive (Rust) — v0.3.0-a

Platform Language License: MIT FOSSA Status

MouseDrive is a Windows application that converts mouse and keyboard input into virtual joystick signals via vJoy, designed for racing simulators.

Old C++ version

Download

Download latest release

Or browse all versions at Releases.

Extract the .zip, place vJoyInterface.dll next to mousedrive.exe, and run.

Features

  • Steering — Mouse X movement mapped to vJoy X axis with 4 modes (linear, expo*, filtered*, self-centering)
  • Throttle — Left mouse button with configurable ramp/drop curves
  • Brake — Right mouse button with full state machine (press, hold, release)
  • Gear buttons — W/S keys mapped to vJoy buttons 1/2
  • Live dashboard — Real-time progress bars for steering, throttle, brake
  • Tabbed settings panel — Collapsible side panel with per-category tuning
  • Config persistence — TOML-based config with load/save/reset
  • Raw input capture — Works even when the window is not focused (F8 toggle)
  • Lock-free architecture — Atomic globals between raw input thread and GUI thread
  • Language support — Turkish and English UI (switchable in Settings > General)

*Experimental

Input / Output mapping

Input vJoy Output Control
Mouse X movement X Axis Steering
Left mouse button (held) Y Axis Throttle
Right mouse button (held) Rz Axis Brake
W key Button 1 Gear up
S key Button 2 Gear down
Middle click Reset steering
F8 Toggle input capture

Quick start

  1. Install vJoy and create a device with X / Y / Rz axes and 2 buttons enabled (Device 1).
  2. Make sure vJoyInterface.dll is accessible (next to the executable or in your PATH).
  3. Run Executable MouseDrive.
  4. Bind your game to the vJoy device axes.

How it works

  • Raw input thread — Dedicated thread with a hidden window that receives WM_INPUT messages for mouse deltas and button states.
  • Atomic communicationAtomicI64, AtomicBool, AtomicU64 for zero-lock data transfer between threads.
  • GUI thread — eframe/egui loop that reads atomics, runs control logic, updates vJoy, and renders the UI.

Requirements

** Tested with V2.2.2.0

Build

cargo build

cargo build --release

Configuration

Settings are stored in TOML format. The config file is loaded from:

  1. <exe_directory>/config.toml (portable mode)
  2. %APPDATA%\MouseDrive\config.toml (standard)

Use the Save / Load / Default buttons in the settings panel, or edit the file manually.

Project layout

MouseDrive/
├── src/
│   ├── main.rs      # App struct, entry point, vJoy connection
│   ├── config.rs    # Config struct, TOML load/save, path resolution
│   ├── input.rs     # Raw input thread, atomic globals, key helpers
│   ├── logic.rs     # Steering/throttle/brake state machine & math
│   ├── ui.rs        # egui UI (side panel, tabs, dashboard)
│   └── vjoy.rs      # vJoy FFI (runtime DLL loading, axis/button API)
├── Cargo.toml
├── LICENSE
└── README.md

Troubleshooting

Problem Solution
"vJoyInterface.dll not found" Place the DLL next to the exe or add its folder to PATH
"vJoy not enabled" Check that vJoy driver is installed and the service is running
"vJoy device busy" Another application is using Device 1 — close it or use a different device
Mouse not captured Press F8 to toggle input capture
Settings not saving Check write permissions in %APPDATA%\MouseDrive\

License

Copyright (c) 2025-2026 Toxpox. This project is licensed under the MIT License.

FOSSA Status

About

MouseDrive, a Windows utility that maps mouse movement and button events onto a virtual joystick exposed by the vJoy driver. The goal is to give racing simulators and other titles that only recognise joystick input a way to interpret mouse steering, throttle, and braking.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages