/// <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; }
private void underlyingHook_KeyUp(object sender, Silence.Hooking.GlobalKeyEventHandlerArgs e) { if (IsRunning) { AddDelayEvent(); CurrentMacro.AddEvent(new MacroKeyUpEvent(e.VirtualKeyCode)); } }
private void underlyingHook_MouseWheel(object sender, Silence.Hooking.GlobalMouseEventHandlerArgs e) { if (IsRunning) { AddDelayEvent(); CurrentMacro.AddEvent(new MacroMouseWheelEvent(e.Point, e.Delta)); } }
private void hook_MouseWheel(object sender, GlobalMouseEventHandlerArgs e) { if (IsRecording) { AddDelayEvent(); CurrentMacro.AddEvent(new MacroMouseWheelEvent(e.Point, e.Delta)); } }
private void hook_MouseDown(object sender, GlobalMouseEventHandlerArgs e) { if (IsRecording) { AddDelayEvent(); CurrentMacro.AddEvent(new MacroMouseDownEvent(e.Point, e.Button)); } }
private void hook_KeyUp(object sender, GlobalKeyEventHandlerArgs e) { if (IsRecording) { AddDelayEvent(); CurrentMacro.AddEvent(new MacroKeyUpEvent(e.VirtualKeyCode)); } }
private void underlyingHook_MouseMove(object sender, Silence.Hooking.GlobalMouseEventHandlerArgs e) { CurrentXY = e.Point; if (IsRunning) { AddDelayEvent(); CurrentMacro.AddEvent(new MacroMouseMoveEvent(e.Point)); } }
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)); } } }