Ejemplo n.º 1
0
 /// <summary>
 /// Registers the base callback if not yet registered.
 /// </summary>
 public void RegisterBaseCallback(vJoy joystick, AFFBManager ffb)
 {
     FFBManager = ffb;
     Joystick   = joystick;
     if (!isRegistered)
     {
         wrapper = FfbFunction1; //needed to keep a reference!
         Joystick.FfbRegisterGenCB(wrapper, IntPtr.Zero);
         isRegistered = true;
     }
 }
Ejemplo n.º 2
0
        public void RegisterBaseCallback(vJoy joystick, uint id)
        {
            this.Joystick = joystick;
            this.Id       = id;
            // Read PID block
            this.Joystick.FfbReadPID(this.Id, ref this.PIDBlock);

            if (!isRegistered)
            {
                this.wrapper = this.FfbFunction1; //needed to keep a reference!
                joystick.FfbRegisterGenCB(this.wrapper, IntPtr.Zero);
                this.isRegistered = true;
            }
        }
Ejemplo n.º 3
0
        public void FfbInterface(uint id)
        {
            // Start FFB Mechanism
            //if (!joystick.FfbStart(id))
            //    throw new Exception(String.Format("Cannot start Forcefeedback on device {0}", id));
            if (RefCounter == 0)
            {
                // Register the callback function & pass the dialog box object
                OnEffectObj = new vJoy.FfbCbFunc(func_OnEffectObj);
                joystick.FfbRegisterGenCB(OnEffectObj, joystick);

                HaltVibThread = false;
                eTh = new System.Threading.Thread(EffectThread);
                eTh.Start();
            }
            RefCounter += 1;
            devices[id - 1].DeviceActive = FFBDevice.DeviceState.Active;
        }
Ejemplo n.º 4
0
        public void FfbInterface(uint id)
        {
            // Start FFB Mechanism
            //if (!joystick.FfbStart(id))
            //    throw new Exception(String.Format("Cannot start Forcefeedback on device {0}", id));
            if (RefCounter == 0)
            {
                // Register the callback function & pass the dialog box object
                OnEffectObj = new vJoy.FfbCbFunc(func_OnEffectObj);
                joystick.FfbRegisterGenCB(OnEffectObj, joystick);

                HaltVibThread = false;
                eTh           = new System.Threading.Thread(EffectThread);
                eTh.Start();
            }
            RefCounter += 1;
            devices[id - 1].DeviceActive = FFBDevice.DeviceState.Active;
        }