Use ViGEm to create XBox 360 controller in C#

  • Hmmn - now the 1.13.1 version isn't working for xbox360 either.

    Was playing around with updating dependencies, but put everything back the way it was, but am now having the same problem with 1.13.1 as 1.15.16

    Will restart and see how I go...

    EDIT --> nope - same issue

    going out of my mind

  • Tried it on another computer with the same result. Thinking it might be a bug of some sort

  • My Virtual Gamepad Emulation Bus version is

    I see is up on Github

    Could I trouble you to compile and sign it so I can give it a go? The one at installed through Powershell and on the caveman instructions: at! are both the version.

    Hoping it may get the Xbox360 gamepads working


  • Version 1.15 or higher isn't ready for a public release yet and not guaranteed to be compatible so I don't recommend you use any other nuget package other than the official older one.

  • Thanks for getting back to me. Any idea what could be stopping it from working properly?

    Are there special timing requirements? Does it require special threading stuff?

    Could it be something to do with me running the latest official Windows 10 update?

    I tried SimWinGamepad at or and am having similar results.

    The gamepad is connected, but the reports don't seem to be registering properly.

    If I do a simple button press and release with SimGamePad.Instance.Use(GamePadControl.A); it works properly, but if I try to do other stuff and then call simPad.Update(0);, nothing at all registers.

    This leads me to believe it's a problem with my code setup or an incompatibility with a Windows update or something similar.

    Could you try compiling my code on your PC and checking if it works?

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading;
    using Nefarius.ViGEm.Client;
    using Nefarius.ViGEm.Client.Targets;
    using Nefarius.ViGEm.Client.Targets.Xbox360;
    using Nefarius.ViGEm.Client.Exceptions;
    namespace ControllerConverter
        class Program
            static ViGEmClient client = new ViGEmClient();
            static Xbox360Controller controller = new Xbox360Controller(client);
            static Xbox360FeedbackReceivedEventArgs previousXbox360FeedbackReceivedEventArgs;
            static void Main(string[] args)
                previousXbox360FeedbackReceivedEventArgs = new Xbox360FeedbackReceivedEventArgs(0, 0, 1);
                controller.FeedbackReceived += new Xbox360FeedbackReceivedEventHandler(OnXbox360FeedbackReceived);
                Console.WriteLine("Virtual Xbox360 gamepad connected.");
                while (true)
                    Xbox360Report report = new Xbox360Report();
                    report.SetButtons(Xbox360Buttons.A, Xbox360Buttons.B, Xbox360Buttons.Up, Xbox360Buttons.LeftShoulder);
                    report.SetAxis(Xbox360Axes.LeftThumbX, 0);
                    report.SetAxis(Xbox360Axes.LeftThumbY, 0);
                    report.SetAxis(Xbox360Axes.RightThumbX, 128);
                    report.SetAxis(Xbox360Axes.RightThumbY, 0);
                    report.SetAxis(Xbox360Axes.LeftTrigger, 0);
                    report.SetAxis(Xbox360Axes.RightTrigger, 0);
                    //Xbox360ReportExtensions.SetButtons(report, Xbox360Buttons.A);
                    //Xbox360ReportExtensions.SetButtonState(report, Xbox360Buttons.A, true);
            static void OnXbox360FeedbackReceived(object sender, Xbox360FeedbackReceivedEventArgs e)
                if (e.LargeMotor != previousXbox360FeedbackReceivedEventArgs.LargeMotor && e.SmallMotor != previousXbox360FeedbackReceivedEventArgs.SmallMotor & e.LedNumber != previousXbox360FeedbackReceivedEventArgs.LedNumber)
                    // Store passed in values
                    byte largeMotorData = e.LargeMotor;
                    byte smallMotorData = e.SmallMotor;
                    byte ledNumberData = e.LedNumber;
                    // Deal with new values
                    Console.WriteLine("Large Motor Data: {0}", largeMotorData);
                    Console.WriteLine("Small Motor Data: {0}", smallMotorData);
                    Console.WriteLine("LED Number: {0}", ledNumberData);
                previousXbox360FeedbackReceivedEventArgs = e;

  • Update

    !!!PROGRESS!!! --> with getting the Xbox 360 controller working.

    Seems I've been able to get it working; somewhat.

    I can set the buttons with eg:

    report.SetButtonState(Xbox360Buttons.A, true);
    report.SetButtonState(Xbox360Buttons.B, false);

    And I can set the triggers with eg:

    report.SetAxis(Xbox360Axes.LeftTrigger, 0x00); 
    report.SetAxis(Xbox360Axes.RightTrigger, 0xFF);

    However I can't get the left and right analogs to move with eg:

    report.SetAxis(Xbox360Axes.LeftThumbX, 0x00);
    report.SetAxis(Xbox360Axes.LeftThumbY, 0xFF);
    report.SetAxis(Xbox360Axes.RightThumbX, 0x00);
    report.SetAxis(Xbox360Axes.RightThumbY, 0xFF);

    Any ideas how I can set them properly?

  • Mystery solved

    The thumb sticks need to be set between -32768 and 32767

    Which means it's now fully working!

    Bet you never thought I'd get there!

    Thanks for your help

  • Yeah that's a pitfall I'm gonna rectify in the upcoming version. Glad you got progress!

  • Hey all, I want to do the same sort of thing as lemmingDev.

    I cloned the ViGEm.NET project but can't get it to properly build. I run build.cmd and get this error:

    Could not find a part of the path 'C:\Users\myuser\Downloads\testwii\ViGEm.NET\build\bin\Release\bin\release\x64\ViGEmClient.dll'.

    Any ideas?

  • @craigrs84 Hey there! Thanks for the interest in building the project. I encourage you to jump into the discord for further support. Forums are slow and tedious while Discord is a lot more handy to help with.

Log in to reply