public void Init(xEmulateForm form) { InfoTextManager.Instance.WriteLine("Initializing DirectInput..."); this.form = form; m_keyboard = new DxI.Device(DxI.SystemGuid.Keyboard); m_keyboard.Properties.BufferSize = 20; m_keyboard.SetCooperativeLevel(form.Handle, DxI.CooperativeLevelFlags.Foreground | DxI.CooperativeLevelFlags.NonExclusive | DxI.CooperativeLevelFlags.NoWindowsKey); m_mouse = new DxI.Device(DxI.SystemGuid.Mouse); m_mouse.Properties.BufferSize = 20; m_mouse.SetCooperativeLevel(form, #if DEBUG DxI.CooperativeLevelFlags.Background | DxI.CooperativeLevelFlags.NonExclusive); #else DxI.CooperativeLevelFlags.Foreground | DxI.CooperativeLevelFlags.Exclusive); #endif InfoTextManager.Instance.Write("Complete."); InitJoy(); }
public Ximulator(xEmulateForm form) { this.ximDyn = XimDyn.Instance; m_form = form; m_varManager = VarManager.Instance; m_eventManager = EventManager.Instance; m_textModeManager = TextModeManager.Instance; m_inputManager = InputManager.Instance; m_infoTextManager = InfoTextManager.Instance; m_prevMouseStates = new Queue<Vector2>(); // Init the vars so we dont have to get them again. m_varManager.GetVar("rate", out m_rate); m_varManager.GetVar("textmode", out m_textMode); m_varManager.GetVar("textmoderate", out m_textModeRate); m_varManager.GetVar("autoanalogdisconnect", out m_autoAnalogDisconnect); m_varManager.GetVar("useximapimousemath", out m_useXimApiMouseMath); this.mouseMath = new MouseMath(); this.betaMouseMath = new BetaMouseMath(); m_utilThread = new UtilThread(); }