SimWinGamePad 1.2.1

dotnet add package SimWinGamePad --version 1.2.1
                    
NuGet\Install-Package SimWinGamePad -Version 1.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SimWinGamePad" Version="1.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SimWinGamePad" Version="1.2.1" />
                    
Directory.Packages.props
<PackageReference Include="SimWinGamePad" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SimWinGamePad --version 1.2.1
                    
#r "nuget: SimWinGamePad, 1.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SimWinGamePad@1.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SimWinGamePad&version=1.2.1
                    
Install as a Cake Addin
#tool nuget:?package=SimWinGamePad&version=1.2.1
                    
Install as a Cake Tool

SimWinGamePad

Usage

Install SimWinGamePad via NuGet or pull the source and add a project reference.

Before issuing other commands, call SimGamePad.Instance.Initialize().

Upon first initialization on a given PC, the user may be prompted to accept automatic installation of the ScpVBus driver required to simulate Xbox 360 GamePads attached to Windows. (This is accomplished via the ScpDriverInterface installer, which is now an embedded resource in SimWinInput and extracted at runtime as needed. Thus you no longer need to explicitly include the installer executable with your own application/installers.) Recovery from missing driver requires neither reboot nor app restart, but Initialize will throw an exception if something prevents success (such as the user declining the prompt or UAC elevation for the installer).

There can be up to four simulated GamePads, but they do not start plugged in. To plug one in as the first GamePad:

SimGamePad.Instance.PlugIn();

Then, to simulate pressing the 'A' button on the GamePad for a moment, before releasing it:

SimGamePad.Instance.Use(GamePadControl.A);

Even the analog controls can be simulated into maximum state for a moment, before returning them to their default, unheld positions:

// Pull and release the left trigger.
SimGamePad.Instance.Use(GamePadControl.LeftTrigger);
// Move the right analog stick into the leftmost position, then return to neutral position.
SimGamePad.Instance.Use(GamePadControl.RightStickLeft);

To unplug the virtual GamePad:

SimGamePad.Instance.Unplug();

When exiting the program, you should always call SimGamePad.Instance.ShutDown(). This will unplug any remaining simulated GamePads and clean up any utilized resources, such as disposing the driver.

Intermediate GamePad Simulation

Should you need more than one GamePad simulated, each command can optionally specify an index from 0 to 3 for which one to drive. You can also specify hold times (in milliseconds) if the default is not suitable for your needs:

SimGamePad.Instance.Use(GamePadControl.LeftTrigger, 2, 500);

You can use GamePadControl as flags to designate multiple controls to use at the same time. You can also simulate controls in a held position until later asking to release them. This example demonstrates both:

SimGamePad.Instance.SetControl(GamePadControl.RightTrigger | GamePadControl.RightBumper);
...
SimGamePad.Instance.ReleaseControl(GamePadControl.RightTrigger | GamePadControl.RightBumper);

Advanced GamePad Simulation

For more advanced scenarios, you can exercise full control over all analog controls and buttons, including the guide button, by modifying and managing state updates manually. For example:

// Get a reference to the state of the first GamePad:
var simPad = SimGamePad.Instance;
var state = simPad.State[0];
// Pull the left trigger halfway back:
state.LeftTrigger = 127;
// Move the right analog stick three quarters of the way to the left:
state.RightStickX = short.MinValue * 3 / 4;
// Add the RightBumber to the set of held buttons:
state.Buttons |= GamePadControl.RightShoulder;
// Update the driver's simulated state with the above state changes:
simPad.Update(0);
...
// Reset the GamePad to the natural at-rest state:
state.Reset();
simPad.Update();
Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net9.0-windows7.0 is compatible.  net10.0-windows was computed.  net10.0-windows7.0 is compatible. 
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.8

    • No dependencies.
  • net10.0-windows7.0

    • No dependencies.
  • net8.0-windows7.0

    • No dependencies.
  • net9.0-windows7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on SimWinGamePad:

Repository Stars
fqlx/XboxKeyboardMouse
Keyboard and mouse for Xbox One streaming on Windows
Key2Joy/Key2Joy
Simulate a GameController/Joystick using your keyboard and mouse.
Version Downloads Last Updated
1.2.1 103 5/2/2026
1.1.2 371 11/17/2024
1.1.1 1,868 3/3/2022
1.1.0 985 9/26/2020
1.0.6 1,370 9/29/2018
1.0.5 2,020 4/22/2018
1.0.4 1,626 3/12/2018
1.0.3 1,567 3/12/2018
1.0.2 1,659 3/12/2018