GameInputSharp.Core is a plain .NET library with no engine-specific code.
Open and build from this repository root (the folder that contains GameInputSharp.Core.sln). All build artifacts (bin, obj) and dotnet pack output are written under that folder. If you moved the project from another path, remove or rename the old folder so tooling and builds use only this copy. This repo has its own .git so Source Link and Git use this directory as the root. You can use it from any C# environment that can load a .NET 8+ assembly and run on Windows.
- Target: .NET Standard 2.1 or .NET 8 (Unity 6+). Prefer .NET 8 when possible.
- How: Reference GameInputSharp.Core (the library output, e.g.
GameInputSharp.Core.dll) inAssets/Plugins(or the project output). Add the Microsoft.GameInput NuGet (e.g. NuGetForUnity). Ensure the GameInput runtime is available on Windows. - Shim: See
samples/GameInputSharp.Samples.Unity/README.mdfor a minimal integration pattern and optional Input System override notes.
- Target: net8.0-windows (or net6.0-windows). Use the Windows DX or Desktop project type.
- How: Add a project reference to GameInputSharp.Core. In
Game.Initialize()create aGameInputManager; inUpdate()callGetDevices()and useGamepadDevice.Hapticsfor rumble. - Sample:
samples/GameInputSharp.Samples.MonoGameshows a minimal game loop with GameInputSharp.
- Target: .NET 8 (Godot 4.2+). Use a Windows export.
- How: Reference GameInputSharp.Core from your Godot C# project. Call from
_Processor_Inputas needed. No special shim; use the same APIs as in the console sample. Ensure the GameInput runtime is present on the Windows build.
- Target: .NET 8. Stride scripts run on the same CLR; reference GameInputSharp and use from a sync or script component.
- How: Add GameInputSharp.Core as a reference, create
GameInputManagerin script start, poll in update. Rumble viaGamepadDevice.Haptics.SetVibration. Windows-only.
- Target: net8.0-windows (or net9.0), WPF/WinUI app.
- How: Add a reference to GameInputSharp.Core. Use
GameInputManagerandGetDevices()from the UI thread or a background thread; marshal results to the UI as needed. For rumble, useGamepadDevice.Haptics. No extra shim required.
| Environment | Reference GameInputSharp.Core | Sample | Documentation |
|---|---|---|---|
| Unity | DLL in Plugins or project | samples/GameInputSharp.Samples.Unity |
Samples — Unity |
| MonoGame | Project reference | samples/GameInputSharp.Samples.MonoGame |
Samples — MonoGame |
| Godot C# | Project reference | samples/GameInputSharp.Samples.Godot |
Samples — Godot |
| Stride | Project reference | samples/GameInputSharp.Samples.Stride |
Samples — Stride |
| WPF / WinUI | Project reference | samples/GameInputSharp.Samples.Wpf |
Samples — WPF / WinUI |
All require Windows and the GameInput runtime (gameinput.dll / GameInputRedist.dll) for devices to be enumerated. For a single index of all samples, see Samples by environment.
- Xbox Elite / wireless adapter: Some Xbox controllers connected via the Xbox Wireless Adapter are exposed to Windows as XInput or through the Xbox Accessories stack; the GameInput API may not enumerate them on all Windows/driver configurations. If the Console sample shows Init: OK, Raw devices: 0, the runtime is fine but no devices are being reported by GameInput. Try connecting the same controller over USB to see if it appears; if it does, the wireless adapter path may not be wired into GameInput on your system. The Xbox Accessories app can still see the device via a different API.