コード例 #1
0
 static VirtualJoystick()
 {
     if (!VJoyNatives.IsVJoyEnabled())
     {
         throw new InvalidOperationException("Unable to find VJoy Driver");
     }
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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));
        }