-
Notifications
You must be signed in to change notification settings - Fork 0
Draft bug: Extending Gremlin to support joystick-like events from "external" devices #6
Description
The idea is to feed joystick-like input from devices that are not read by Dill, without making too many changes/adding dependencies into Gremlin.
For example, a couple of projects I'm going to look into in the near future (and how these are currently accomplished):
- Use VR controllers as a joystick
- Reading from SteamVR (OpenXR in the future, maybe...) and writing to vJoy directly (SteamVR wheel, Elite VR Cockpit)
- FreePIE has/had VR plugin support but it's not exactly maintained anymore
- vorpX can emulate XBox controllers from VR ones, probably by DLL injection, not sure
- Virtual Desktop reads from VR controllers and writes to vigembus (and maybe vjoy also)
- Use a hacky Arduino/Pi/Something project as a joystick
- Usually folks will read from a serial or network port and write to vJoy
- Very determined folks can implement a HID device - some open source implementations exist
- Or just buy a USB joystick board for fairly cheap - they have analog and digital input pins.
For either use case, if they can feed into vJoy, they can be fed into Gremlin, but they still need to feed into vJoy, and the setup will be a bit harder to set up, reason about and debug because of the additional systems involved.
I was thinking that Gremlin could expose an API for "joystick providers" that could be much easier to use (and marginally faster, by avoiding an intermediate vJoy device). Through the API, this provider could:
- Provide information about the joystick (like the Dill device summary)
- Be able to generate joystick input events
The current Dill provider could just be an implementation of this API. Importing such a plugin would create additional joystick devices that Gremlin would treat as physical devices (so, separate tabs in the UI, fixed UUIDs defined by the plugin, mappings are saved in the profile).
I'm not sure what's the best way to try adding this into Gremlin. Naively, to minimize additional code in Gremlin, we could leverage the current Scripts module and UI, create a separate tab for such (non-Dill) providers, where you can import a Python script implementing the provider, and control its parameters via the existing string/bool/float/int controls.