/// <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; } }
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; } }
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; }