private void InterceptMouse_MouseEvent(object sender, MouseHookEventArgs e) { if (m_recordingActive && (e.Type == MouseHookEventType.LButtonDown || e.Type == MouseHookEventType.RButtonDown)) { switch (m_recordStep) { case FeedRecordStep.FeedButtonLocation: m_setup.LocationFeedButton = new Point(e.X, e.Y); lblFeedButtonValue.Text = string.Format("X:{0}, Y:{1}", e.X, e.Y); m_recordStep = FeedRecordStep.FeedConfirmButtonLocation; lblText.Text = "Confirm button drücken"; break; case FeedRecordStep.FeedConfirmButtonLocation: m_setup.LocationFeedConfirmButton = new Point(e.X, e.Y); lblConfirmButtonValue.Text = string.Format("X:{0}, Y:{1}", e.X, e.Y); lblText.Text = string.Empty; m_recordingActive = false; MouseHook.Stop(); break; } } }
private void btnRecord_Click(object sender, EventArgs e) { if (!m_recordingActive) { MouseHook.Start(); m_recordingActive = true; m_recordStep = FeedRecordStep.FeedButtonLocation; lblText.Text = "Feed button drücken"; } }