/// <summary> /// Called when mouse down. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="MouseEventArgs"/> instance containing the event data.</param> private void OnMouseDown(object sender, MouseEventArgs e) { ButtonType button = GetButton(e.Button); Point p = Cursor.Point; mouseDownPosition = new Click(x: p.X, y: p.Y, button: button, shift: isShiftDown, ctrl: isCtrlDown, alt: isAltDown); }
/// <summary> /// Adds the instruction or increments the repetitions. /// </summary> /// <param name="instruction">The instruction.</param> /// <returns></returns> private bool AddOrIncrement(Instructions.Instruction instruction) { int delay = GetDelay(); if (currentInstruction == null || currentRun == null) { currentInstruction = instruction; } else if (instruction.Resembles(currentInstruction) && instruction is Wheel wheel && delay < MOUSE_REPETITION_MAX_DELAY) { ((Wheel)currentInstruction).ScrollDistance.Inc(wheel.ScrollDistance.Value); }
/// <summary> /// Initializes a new instance of the <see cref="Text"/> class. /// </summary> /// <param name="input">The input.</param> /// <param name="instruction">The instruction.</param> public Text(string input, AutoClicker.Instructions.Instruction instruction = null ) : this(input, instruction.Delay(), instruction.Repetitions, instruction.Speed(), instruction.Ctrl, instruction.Alt) { }