What exactly are you trying to do or which API do you want to use? Windows.Gaming is just a namespace (not a DLL) that contains several sets of APIs (.Input, .UI, .XboxLiveStorage., etc.).
What exactly is the problem you’re encountering? Is the problem when building your project/app or running it, i.e. compile errors or a runtime exception? Is the problem in Unity Editor or Visual Studio?
When you say “DLLs I’ve written”, what exactly are they: managed or native? Are you including them in your Unity project (Plugins) or trying referencing them directly from Visual Studio?
I tried bringing in a managed dll using Windows.Gaming.Input and I encountered that error I mentioned above: Windows.Foundation.UniversalApiContract is missing.
I’m wondering if this is even testable in the editor…
So, let me get this out of the way: using HID on UWP is a nightmare; the WinRT APIs around HID are awful and practically worthless. Microsoft seemed to go out of its way to hide the HID Report data making it very difficult to find the bit/byte offset for a given control.
So, in your case using the WinRT RacingWheel API might be the best option, since even if you do find the Output Report control offsets for your racing wheel, they probably won’t match those on a different device.
BTW, a set of Input System layouts for various force-feedback devices would be a nice addition to the Asset Store.
You can invoke WinRT API directly from scripts, however since they won’t compile in the Editor you have to enclose them with #ifdef. The WinRT APIs will work when you build/run the actual UWP app.
So for example:
#if ENABLE_WINMD_SUPPORT
var racingWheel = Windows.Gaming.Input.RacingWheel.RacingWheels.FirstOrDefault();
if (racingWheel != null)
{
if (racingWheel.WheelMotor != null)
{
var axes = racingWheel.WheelMotor.SupportedAxes;
if (Windows.Gaming.Input.ForceFeedback.ForceFeedbackEffectAxes.X == (axes & Windows.Gaming.Input.ForceFeedback.ForceFeedbackEffectAxes.X))
{
// Force can be applied through the X axis
}
}
}
#endif
I recommend writing a basic UWP “test app” in Visual Studio to implement the RacingWheel APIs and then port the code into Unity (easier to test this way).