public static void RawInput_Install(System.IntPtr handle) { MainForm._rawinput = new RawInput.RawInput(handle); MainForm._rawinput.CaptureOnlyIfTopMostWindow = true; MainForm._rawinput.AddMessageFilter(); MainForm._rawinput.InputEvent += new RawInputDriver.DeviceEventHandler(MainForm.OnRawInput); }
public RawInput(IntPtr parentHandle) { try { base.AssignHandle(parentHandle); RawInput._rawinputDriver = new RawInputDriver(parentHandle); RawInput._rawinputDriver.EnumerateDevices(); this._devNotifyHandle = RawInput.RegisterForDeviceNotifications(parentHandle); } catch (Exception ex) { DebugCenter.GetInstance().appendToFile(ex.Message + "\r\n" + ex.StackTrace); } }