Cronus Controller AdapterA while back, I wrote an article showing how to automate video games using the Cronus controller adapter. At the end of that article, I promised that I would upload the source code for the wrapper I was creating for use with C# apps. Even though I had finished that code shortly thereafter, I do not have the code available so that I can share it. However, over the weekend, I received an interest from a reader that was working on a similar project and needed help getting his C# wrapper working. During that discussion, I put together a very simple working version of the wrapper for him to use. Even though it isn’t fully functioning like the last wrapper I wrote, this wrapper still provides most of the functionality one would need for communicating with their Xbox or PlayStation from their computer. I’m also providing the source code so that anyone interested can finish out any missing pieces they might need.

The ZIP file (available at the end of this article) includes 2 projects. The first project is the wrapper itself. This project generates a DLL file that you can reference in your other Cronus-controlled applications. Just make sure you also include the gcdapi.dll file as this is what the wrapper encapsulates. The second project in the ZIP is a simple interface that can be used with the Xbox 360. Currently it only supports button controls for D-Pad Up, Down, Left, & Right as well as A, B, X, & Y as shown here.

Cronus Xbox 360 Interface

To use this interface, you will need to connect the Cronus controller adapter to your Xbox 360 and connect a wired Xbox 360 controller to the Cronus controller adapter. Next, you will need to connect your computer to the Cronus controller adapter using the USB cable provided with the adapter. With everything connected, launch the app and click the “Is Connected?” button. If everything is working correctly, you should see the word “True” next to that button and the other buttons on the form should become enabled. If they do, you can test the app by clicking any of the controller buttons. The D-Pad buttons will need to have their values changed in the code in order to work correctly. Otherwise, when you click one of those buttons your Xbox will repeat the command multiple times. For example, if you click the “Right” button, your Xbox will scroll to the right several times before it stops whereas you will need to change the code to make it only scroll once for every click.

That’s it. You should now be able to control your Xbox 360 from your computer. You can also add support for the Nintendo Wii and the Sony PlayStation 3 & 4 by following the Device API documentation at http://www.gamepadproxy.com/manual/. Just click on “Device API” on the left-side menu and click “API Reference”. At the bottom of that page you will find the corresponding codes for the console you want to provide support for. Most of the codes are the same regardless of what console you are using. You will also find the documentation for the functions I did not complete the wrapper for.

Here is the source code for the wrapper as well as the example application as shown above. Feel free to modify this code and use it as you please. The only stipulation is that you use it in accordance with the GCD API & Cronus license agreements since that is what this wrapper is built for.

Download: CronusController.zip (90KB)
Includes gcdapi.dll which can be found in the CronusController/bin/Debug/ folder along with the GCAPIWrapper.dll (source code provided) and the CronusController.exe app shown above (source code also included).

Update: I have updated the app to include controller feedback. Check it out and download the latest version of the app by clicking here.

P.S. I take no responsibility for any damages that may occur to your console or Cronus controller adapter by using the software provided in this article.

Thank you for your interest in my site. If you find the information provided on this site useful, please consider making a donation to help continue development!

PayPal will open in a new tab.
$2.00
$5.00
Other

Related Posts

Tagged with:  

5 Responses to Cronus Game Controller API Wrapper for C#

  1. Nefylem says:

    Cool project. Was a great simple wrapper to use in c#
    Just wondering if you know how to use gcapi_read. I tried pointing the class to it but it crashes every time on me.

    • LuCuS says:

      Sorry for the late reply. I kept meaning to work on this, but didn’t have time until tonight. I have added the ability to read the status of your controller. As you can see in the screenshot, whenever you press a button on the controller, it is reflected in the buttons at the bottom of the form. I know it’s not pretty, but at least it works. I have also uploaded the new version of the app which you can get from http://www.prodigyproductionsllc.com/downloads/CronusController_v2.zip.

      Cronus Controller v2

    • LuCuS says:

      BTW, if you press buttons on your controller while the Cronus is connected to your console, the buttons will be forwarded to your console. That means you can play your games and see your buttons being pressed in the app at the same time.

  2. Nefylem says:

    I completely forgot about this project. That works great, thank you 🙂

Leave a Reply