示例#1
0
        /// <summary>
        /// Adds a delay event to the current macro representing the time in ticks since this method was last called.
        /// </summary>
        private void AddDelayEvent()
        {
            long timeNow = DateTime.Now.Ticks;

            CurrentMacro.AddEvent(new MacroDelayEvent(timeNow - lastEventTime));
            lastEventTime = timeNow;
        }
示例#2
0
 private void underlyingHook_KeyUp(object sender, Silence.Hooking.GlobalKeyEventHandlerArgs e)
 {
     if (IsRunning)
     {
         AddDelayEvent();
         CurrentMacro.AddEvent(new MacroKeyUpEvent(e.VirtualKeyCode));
     }
 }
示例#3
0
 private void underlyingHook_MouseWheel(object sender, Silence.Hooking.GlobalMouseEventHandlerArgs e)
 {
     if (IsRunning)
     {
         AddDelayEvent();
         CurrentMacro.AddEvent(new MacroMouseWheelEvent(e.Point, e.Delta));
     }
 }
示例#4
0
 private void hook_MouseWheel(object sender, GlobalMouseEventHandlerArgs e)
 {
     if (IsRecording)
     {
         AddDelayEvent();
         CurrentMacro.AddEvent(new MacroMouseWheelEvent(e.Point, e.Delta));
     }
 }
示例#5
0
 private void hook_MouseDown(object sender, GlobalMouseEventHandlerArgs e)
 {
     if (IsRecording)
     {
         AddDelayEvent();
         CurrentMacro.AddEvent(new MacroMouseDownEvent(e.Point, e.Button));
     }
 }
示例#6
0
 private void hook_KeyUp(object sender, GlobalKeyEventHandlerArgs e)
 {
     if (IsRecording)
     {
         AddDelayEvent();
         CurrentMacro.AddEvent(new MacroKeyUpEvent(e.VirtualKeyCode));
     }
 }
示例#7
0
 private void underlyingHook_MouseMove(object sender, Silence.Hooking.GlobalMouseEventHandlerArgs e)
 {
     CurrentXY = e.Point;
     if (IsRunning)
     {
         AddDelayEvent();
         CurrentMacro.AddEvent(new MacroMouseMoveEvent(e.Point));
     }
 }
示例#8
0
        private void underlyingHook_KeyUp(object sender, Silence.Hooking.GlobalKeyEventHandlerArgs e)
        {
            bool?result = ShortcutHandler?.Invoke(e);

            if (result == null || result == true)
            {
                if (IsRunning)
                {
                    AddDelayEvent();
                    CurrentMacro.AddEvent(new MacroKeyUpEvent(e.VirtualKeyCode));
                }
            }
        }