public void StartMouseRecord() { if (mh == null) { data = new List <HookData>(); mh = new MouseHook(); mh.SetHook(); mh.MouseDownEvent += Mh_MouseDownEvent; mh.MouseUpEvent += Mh_MouseUpEvent; } }
public Form1() { InitializeComponent(); MouseHook.Start(); MouseHook.MouseActionLD += new EventHandler(OnLeftDown); MouseHook.MouseActionRD += new EventHandler(OnRightDown); MouseHook.MouseActionMD += new EventHandler(OnMiddleDown); MouseHook.MouseActionLU += new EventHandler(OnLeftUp); MouseHook.MouseActionRU += new EventHandler(OnRightUp); MouseHook.MouseActionMU += new EventHandler(OnMiddleUp); }