public void GetEnabledDevices() { var joystick = new vDev(); log.Info("Get virtual devices able to be acquired..."); List <int> enabledDevs = new List <int>(); log.Info("Check drivers enabled: "); IsDriverEnabled(DevType.vJoy); bool owned = false; bool exist = false; bool free = false; // loop through possible vJoy devices for (int i = 1; i <= 16; i++) { joystick.isDevOwned((uint)i, DevType.vJoy, ref owned); joystick.isDevFree((uint)i, DevType.vJoy, ref free); joystick.isDevExist((uint)i, DevType.vJoy, ref exist); if (free || owned) { log.Info("Found vJoy device " + i.ToString()); enabledDevs.Add(i); } } EnabledDevices = enabledDevs; }
public VJoyOutputDevice() : base() { _Joystick = new vDev(); DriverEnabled = false; VDevAcquired = false; _HDev = 0; Keybind = "Left Thumbstick"; }