Beispiel #1
0
        public void ConvertToTable()
        {
            dataTable.Rows.Clear();
            int i = 0;

            foreach (MacroRecordEntry entry in recorder.Entries)
            {
                MacroRecordingsDataSet.MacroEntriesRow row = (MacroRecordingsDataSet.MacroEntriesRow)dataTable.NewRow();
                row.Time = (int)entry.Time;
                //row.OrigIndex = i;
                if (entry.Input.type == 0)                 //mouse input
                {
                    row.X = (int)(entry.Input.mi.dx * Screen.PrimaryScreen.Bounds.Width / 65535f);
                    row.Y = (int)(entry.Input.mi.dy * Screen.PrimaryScreen.Bounds.Height / 65535f);
                    MouseEvents evt = (MouseEvents)(entry.Input.mi.dwFlags & 0x7fff);
                    row.Action = evt.ToString();
                }
                else if (entry.Input.type == 1)                 //kb input
                {
                    if ((entry.Input.ki.dwFlags & (uint)KBEvents.KEYUP) != 0)
                    {
                        row.Pressed = false;
                    }
                    else
                    {
                        row.Pressed = true;
                    }
                    row.Key = System.Windows.Input.KeyInterop.KeyFromVirtualKey(entry.Input.ki.wVk).ToString();
                }
                dataTable.Rows.Add(row);
                i++;
            }
        }
Beispiel #2
0
 /// <summary>
 /// HOOK MouseEvent event.
 /// </summary>
 /// <param name="mouseEvent">The mouse event.</param>
 /// <param name="mouse">The mouse.</param>
 /// <param name="delayTime">The delay time.</param>
 void kbmHOOK_MouseEvent(MouseEvents mouseEvent, MSLLHOOKSTRUCT mouse, int delayTime)
 {
     OnRecording(mouseEvent.ToString() + "|" + mouse.pt.ToString());
     this.kbmActionRecorder.WriteData(mouseEvent.ToString(), mouse, delayTime);
 }
        private void ReportMouseEvent(MouseEvents mEvent, MouseHookEventArgs mea)
        {
            string msg = string.Format("Mouse event: {0}: {1}.", mEvent.ToString(), mea.ToString());

            AddText(msg);
        }
Beispiel #4
0
 /// <summary>
 /// Hook the MouseEvent event.
 /// </summary>
 /// <param name="mouseEvent">The mouse event.</param>
 /// <param name="myMouse">My mouse.</param>
 /// <param name="delayTime">The delay time.</param>
 void MHook_MouseEvent( MouseEvents mouseEvent, MSLLHOOKSTRUCT myMouse,int delayTime)
 {
     OnRecording(mouseEvent.ToString()+"|"+myMouse.pt.ToString());
     mActionRecorder.WriteData(mouseEvent.ToString(), myMouse, delayTime);
 }
Beispiel #5
0
 private void MouseHook_MouseEvent(MouseEvents mEvent, Point point)
 {
     textBox1.Text += mEvent.ToString();
 }