Skip to content

ShihaoDevLab/Controller2Mouse

Repository files navigation

Controller2Mouse

A Windows application that maps Xbox controller inputs to mouse movements and actions, allowing you to control your cursor with a gamepad.

Features

  • Mouse Movement: Use the right analog stick to move the cursor
  • Scroll Control: Use LT/RT triggers to scroll up/down
  • Mouse Buttons:
    • Left Stick Press → Right Click
    • Right Stick Press → Left Click
    • Both Sticks Press → Middle Click
  • Virtual Keyboard: Press both thumbsticks simultaneously to open the on-screen keyboard
  • Auto-Detection: Automatically detects and connects to available controllers
  • Multi-language Support: English, 简体中文,繁體中文,日本語
  • Modern UI: Clean, transparent window design with Windows 11 styling

Requirements

  • Windows 10 version 19041.0 or higher
  • .NET 11.0 Runtime
  • Xbox controller (or compatible DirectInput controller)

Installation

Download Pre-built Release

Download the latest release from the Releases page. The application is published as a self-contained single-file executable, so no additional dependencies are needed.

Build from Source

# Clone the repository
git clone <repository-url>
cd Controller2Mouse

# Build the project
dotnet build -c Release

# Publish as single-file executable
dotnet publish -c Release -r win-x64 --self-contained true /p:PublishSingleFile=true

The published executable will be in bin/Release/net11.0-windows10.0.26100.0/win-x64/publish/.

Usage

  1. Launch Controller2Mouse.exe
  2. Connect your Xbox controller via USB or Bluetooth
  3. The application will automatically detect the controller
  4. Click "Start Mapping" to begin controlling the mouse
  5. Click "Stop Mapping" or close the application to exit

Controls

Controller Input Mouse Action
Right Stick Move Cursor
LT Trigger Scroll Up
RT Trigger Scroll Down
LT + RT Middle Click
Left Stick Press Right Click
Right Stick Press Left Click
Both Thumbsticks Press Open Virtual Keyboard

Configuration

Advanced users can modify the following constants in ControllerToMouseMapper.cs:

  • Deadzone: Controller stick deadzone threshold
  • SensitivityX: Horizontal mouse sensitivity (default: 0.0005f)
  • SensitivityY: Vertical mouse sensitivity (default: 0.0005f)
  • ScrollSensitivity: Scroll wheel sensitivity (default: 0.1f)

Technology Stack

  • Framework: .NET 11.0 with WPF
  • Input Library: Windows.Gaming.Input (Built-in WinRT API)
  • Platform: Windows 10/11

Development

Project Structure

Controller2Mouse/
├── App.xaml                 # Application entry point
├── MainWindow.xaml          # Main UI window
├── ControllerToMouseMapper.cs  # Core controller-to-mouse mapping logic
├── MouseSimulator.cs        # Windows SendInput API wrapper
├── Languages/               # Localization resources
│   ├── en-US.xaml
│   ├── zh-CN.xaml
│   ├── zh-TW.xaml
│   └── ja-JP.xaml
└── Controller2Mouse.ico     # Application icon

Building

# Debug build
dotnet build

# Release build
dotnet build -c Release

# Run the application
dotnet run

Troubleshooting

Controller not detected:

  • Ensure the controller is properly connected
  • Try pressing any button to wake up the controller
  • Check Device Manager for controller drivers

Cursor movement too fast/slow:

  • Adjust SensitivityX and SensitivityY values in the source code
  • Rebuild the application after changes

Application won't start:

  • Ensure .NET 11.0 Runtime is installed
  • Check Windows Event Viewer for error details

License

This project is provided as-is for educational and personal use.

Acknowledgments

  • Built with Windows.Gaming.Input for modern gamepad support
  • Uses Windows SendInput API for mouse simulation

About

Make Full Use Of Your Controller

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages