static VirtualJoystick() { if (!VJoyNatives.IsVJoyEnabled()) { throw new InvalidOperationException("Unable to find VJoy Driver"); } }
public void SendData(VirtualJoystickData data) { if (IsDisposed) { throw new InvalidOperationException("already disposed"); } if (!IsAquired) { throw new InvalidOperationException("Not aquired yet"); } var vJoyData = data.ToNative(); VJoyNatives.SendData(DeviceId, ref vJoyData); }
public void Unaquire() { if (IsDisposed) { throw new InvalidOperationException("already disposed"); } if (!IsAquired) { throw new InvalidOperationException("Not aquired yet"); } Logger.Info("Unaquire virtual joystick " + this); VJoyNatives.UnacquireVJoy(DeviceId); }
public bool Aquire() { if (IsDisposed) { throw new InvalidOperationException("already disposed"); } if (IsAquired) { throw new InvalidOperationException("Already aquired"); } Logger.Info("Aquire virtual joystick " + this); return(VJoyNatives.AcquireVJoy(DeviceId)); }