SimHub and Windows HID, MIDI and other controllers

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
  1. Writing a SimHub plugin would be too hard, disproved by MIDIio.
  2. Differences between DirectInput and XInput were unimportant.
  3. SimHub Custom serial to STM32/ESP32 Arduino for HID game controller emulation.
    Unlike FTDI USB chips, CH340G on D1 UNO can only be serial.
  4. 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.
  5. ViGEm would be easier (better documented, more robust) than vJoy.
  6. 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
  1. 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"
  2. Convert COM device to HID?
  3. ViGEm.NET provides a signed UWD "virtual bus" driver,
    to which userland programs can filter unsupported devices

workaround for workaround

Doomed efforts

  • STM32 pedals
  • ESP8266 pedals
  • WeMos D1 UNO R1 ESP8266
  • mi-360 fork - practice for hacking ViGEm.NET into VJoySerialFeeder

    Ideal approach(?)

  • Integrate SimHub and e.g. fake8 plugin to Universal Control Remapper (UCR) via MIDIio.
  • Return STM32 inputs by USB COM port as MIDI CCs for fake8 plugin to set SimHub properties.
  • maintained by blekenbleu