- Given:  documented and working SimHub plugin that receives and sends MIDI CC,
- app receiving DirectInput and sending to vJoy,
working for Windows 10 and 11,
- Then:  adding parts of that app to the MIDIio plugin became a fairly obvious to-do.
Before diving into the vJoy sender app single (but 828 line) C# source
file,
sorted its API by revising
the vJoy C# wrapper SDK document,
converted to Markdown..
Next step was branching MIDIio before copying over that source file and pair of DLLs.
Background
- DirectInput
- traditional HID devices, e.g.:  mouse, keyboard, joystick, gamepad
vJoy generates virtual DirectInput devices - DualShock 3
- How to use a PS3 DualShock 3 controller on Windows 7 - 11 via DsHidMini
- XInput
- Up to 4 controllers that work with Xbox consoles, e.g. Xbox 360
Wanted (as well as MIDI): game controller output from SimHub,
which it typically implements via Arduino
DirectInput and XInput issues aside, vJoy keeps virtual game devices visible with no app running,
which avoids confusing Assetto Corsa or other games by devices disappearing and reappearing,
e.g. when SimHub restarts plugins during game changes.
- SimHub output to vJoy is wanted for 2-paddle clutch, among other things.
- MIDI output is wanted to modulate ShakeIt effect volume for clutch and loaded wheel slips...
- ... while also continuing to control speed wind fans and (direct drive) harness tensioning
click for doomed assumptions
- Writing a SimHub plugin would be too hard, disproved by MIDIio.
- Differences between DirectInput and XInput were unimportant.
- SimHub Custom serial to STM32/ESP32 Arduino for HID game controller emulation.
Unlike FTDI USB chips, CH340G on D1 UNO can only be serial. - According to Jan Axelson, Microsoft supports HID devices via DirectX
... but HID support is NOT found in .NET APIs
and most Sim controller peripherals use classic DirectInput. - ViGEm would be easier (better documented, more robust) than vJoy.
- Microsoft's MonoGame GamePad Reference
strongly implies that Input for games
support
may be only for Xbox One and PS/4 Game Controllers and mainly via UWP.
click for doomed approaches
- Make other game controllers look (enough) like Xbox,
while avoiding the hassle of releasing custom signed Windows drivers.- Windows 1809 wants all drivers to be Universal Windows Drivers
UWD
AKA (by Intel) "Modern Windows Drivers"
- Windows 1809 wants all drivers to be Universal Windows Drivers
UWD
- Convert COM device to HID?
- Traditional COM<>HID workaround:  vJoy - "no longer supported" (but it works!)
- Serial-Lab fork already working with D1 UNO ESP8266
- VJoySerialFeeder least obsolete COM->HID filter
- mi-360 HID Xiaomi Gamepad -> Xbox360 filter
- ViGEm.NET provides a signed UWD "virtual bus" driver,
to which userland programs can filter unsupported devices
workaround for workaround
- Arduino IBUS sketch running on ESP8266
- mi-360 uses ViGEm.NET, which *is* supported.
- C# interface code for Xiaomi Gamepad
- Ultimately, derive a dedicated serial<>ViGEm filter from mi-360 fork
- presumably need to understand HIDLibrary on GitHub
- vigem-example-dotnet - C# ViGem.NET SDK (virtual) XBox 360 controller