Universal, idiomatic C# wrapper for Microsoft.GameInput. Targets .NET 8+ with optional shims for Godot

GameInput C# Wrapper (Alpha Release)

Are you looking to add robust controller support and take full advantage of advanced haptics in your game using Microsoft’s modern GameInput API — without the overhead of writing a complete C++ wrapper from scratch?

Good news: I’ve created a comprehensive C# wrapper for the GameInput API.

Key Features

  • Full exposure of the GameInput API surface in clean, idiomatic C#
  • Complete support for:
    • All input controls (buttons, analog sticks, triggers, touchpads, etc.)
    • Advanced force feedback and haptic events
  • Detailed XML documentation on every public member
  • Designed for seamless integration into Unity, Godot, MonoGame, or any .NET-based game/engine

This is an alpha release. While I’ve aimed for broad coverage and stability, some edge cases and platform-specific behaviors may still need refinement.

Get Started

  1. Download the latest release from the Packages page
    (or clone the repo and build it yourself)
  2. Reference the provided .dll in your project
  3. Check the included Godot documentation and example code in the /samples folder

Contributing

I warmly invite the community to try it out in real projects.

  • Found a bug? Missing functionality? Have a suggestion?
    → Please open an Issue
  • Have an improvement or fix?
    → Feel free to fork the repo and submit a pull request

All contributions — big or small — are greatly appreciated and will be carefully reviewed.

Thank you for helping make GameInput more accessible to C# developers!

Happy coding,
@Fenris159

Hey, this is cool and all, but could you tell us how much of this is AI and how much of this is your work?

I’m asking because your post itself seems to be entirely written by AI.
Your profile picture both here and on GitHub seems to be AI generated.
You have absolutely no prior GitHub contributions, only a small burst recently, then nothing else again.
The code seems to be full of very AI-like code bits and pieces
Your repository contains the Cursor Agent, which is AI.

1 Like

I use AI assistance for document generation because I have a very busy life and it generates clean markdown. Everything I make using AI assistance is completely hands on with maximum oversight and I test the code as much as I can. There are theoretical cases where I allow it to code for situations outside what I can test but that’s why everything is open source so I can get feedback and user logs. So this is not as simple as “build me this” and send it. I put hours into code review and correct things as I move along. Is there a problem with me using ai to speed up code generation?

Also the recent github contributions is me trying to get back into practice. I stopped coding years ago and ended up working a trade to support my family and I am kinda tired of manual labor so I am carving out personal time to try and re-educate myself and catch back up. Hopefully by the end of the year I can recertify and make a break into the industry as a programmer. So you will see me pump out more future projects as I come up with ideas. Right now I am working on some java project for my friend’s Hytale server lol. It’s just doing the thing to get better ya know?

I do very much believe people should be aware that you used AI for most, if not all of your project.

I know they’re not a 100% guarantee, but I’ve went through and put your code through simple AI code checkers, and almost every single file came up to 90 to a 100% match, and to be honest, you can see it too.
Almost everything in that repository was made with AI and nothing else. You might have changed a few things here and there, but from what I can tell, you simply told Cursor to create this project for you, along with the post we’re seeing here, as well as the documentation.

2 Likes

For one, this is a huge contradiction. You say everything you made using AI is completely hands on, but then you say “There are theoretical cases where I allow it to code for situations outside what I can test”. This is nowhere near “maximum oversight” in any way, shape or form.

This doesn’t seem like a beginner or “refresher” friendly project in any way.

And, as I said, this would’ve been a lot easier to believe if your repo had actual commits people could review. As it stands right now, you have 3 commits, two of which are essentially just nitpick file changes and github specific stuff like funding, and ONE entire commit is dedicated to just… the whole project? All in one? That doesn’t seem right in any way.

1 Like

Yes. Especially in open source. Not only there’s the question of license (since you have no idea what kind of code the AI used / stole), but people who would use your library would expect you to understand every part of it, and if issues came up at any point with any module or code piece, you should be able to fix that. If you used AI, even for just “some” parts of your code (which is already questionable), you likely do not understand what that code does, or how it does it. So you would not be able to fix it.

2 Likes

How many commits do you want me to have? I build the alpha release entirely locally and tested it locally before the initial commit. I was inspired to build a wrapper after updating an older project that used forcefeedback to simulate rumble for Elite Dangerous by triggering events from parsing journal files. I ran into trouble with detection because the program was writting in C# and ended up having to make a custom wrapper to get DirectInput to detect. So this was sort of inspired because I noticed NOBODY had addressed this issue fully. I don’t understand what code you think could be stolen to write a wrapper for an API that microsoft wrote for their SDK and GDK. It’s literally just allowing you to use what they already made. Now I would understand your concerns if this was something more artistic in approach but it’s pretty cut and dry wouldn’t you think so? I get the sense that you have some personal apprehension towards AI tools and I’m not going to pretend to assume that your upset but a big part of the reason I am able to get back into coding is the ability to actively code with agent assistance. I am not some vibe coder, I am actively reading and editing the code behind the models. I am also using it as a tutor so in a sense it’s free education. The bar to entry has been lowered a lot, when I was in college years ago you had to endure high tuition and hours of nonsense to get to this point. All I am doing is putting my ideas into practice and trying to bring something positive to other’s who might want to build on it. AI or not if it works properly and becomes community driven I don’t see the problem.

That’s a weird question for someone who claims to be a programmer.

So you decided to build an entire project locally with absolutely no version control systems in place? What if you wanted to revert a commit because it didn’t work perfectly the first time?

This is a really weak defense on your part, but now you contradicted yourself one more time. Now you’re saying the AI did most of the work for you and I’m just “upset” that it’s all AI? Besides, this misses the whole point if my argument. The issue isn’t AI, the issue is that you claim you made this:

And now you’re saying “yeah of course I used AI, what’s wrong with that?”

Besides, I don’t see the point of the project.

Something like this is already built straight into Unity, this is literally just doing the same thing Unity can already do.
This is also built into MonoGame as is, since… you know, monogame is built on top of the old XDA libraries.
And godot’s input system is already incredibly good.

1 Like

I didn’t claim the code, AI or otherwise. I claimed the creation of the project. A human brain is still required to direct AI, it didn’t just come up with the idea and place it on my computer. Look, I’m not here to argue. If you say that what’s build into the existing engine’s is just fine or good enough then hey great! It’s here if you want to use it. Nobody is forcing you to participate. If you can write it better, that’s what we’re here for.

The thing is you could just say “
I used AI to vibe code it “ or something similar , that doesn’t mean is not working but people like to know it .

Recently here is quite loud about AI because it puts extra strain on PR

:sign_of_the_horns:

I read about the rampant issues affecting github with ai making pr’s. I would never work on somebody else’s repo and send ai generated pr. I think they will probably put something in place to check where the PR comes from and allow the admin to deny them automatically.

I will say though because most IDE’s have ai integration now its real easy to be lazy and just tell the ai to automate certain tasks done in terminal so even if they write the code themselves you can still tell ai what to do to finish up and effectively walk away as your computer automates

Well I tried it , but wasn’t for me as I probably just don’t have good enough understanding to verify it or ask correctly what to do .

If it’s works for you - cool .

But from what I understood mostly it’s trained on all available resources ( which wasn’t only open source ) and might be lots of non functioning snippets there so at some point you are stealing someone else code not directly but via prompt .

Yeah I went through a lot of trial and error with it. I ended up using cursor’s ide it calls on several models depending on the task. You have to put in a lot of rules and use skills to kinda specialize the agent and put guardrails on it before you start prompting it. I’m constantly having to update the rules when I catch it deviating. I think it’s helpful for rapid deployment. You can set up your environment quickly and build out a skeleton of your project before getting into the meaty bits so for some people I know it’s a huge convenience for some of the more repetitive tasks.

I agree with @tibaverus but I’m willing to give you the benefit of the doubt as far as your motives. You were trying to share a cool thing. However I doubt you’re going to find a lot of adoption on the forum here. For two reasons.

  1. It’s C# only. Most people on here use GDScript.
  2. Most people on here are distrustful of AI code.
3 Likes