public async Task TestMouseMoveTo() { var sim = new EventBuilder(); sim .MoveTo(0, 0) .Wait(1000) .MoveTo(65535, 65535) .Wait(1000) .MoveTo(65535 / 2, 65535 / 2) ; await sim.Invoke(); }
public async Task AnotherTest() { var sim = new EventBuilder() .Click(KeyCode.Space) .ClickChord(KeyCode.LWin, KeyCode.R) .Wait(1000) .Click("mspaint") .Wait(1000) .Click(KeyCode.Return) .Wait(1000) .Hold(ButtonCode.Left) .MoveToVirtual(65535 / 2, 65535 / 2) .Release(ButtonCode.Left) ; await sim.Invoke(); }
public override void StartAction() { string keys = Model.Keys; EventBuilder eventBuilder = Simulate.Events(); string[] events = keys.Split('|'); foreach (string keyEvent in events) { if (keyEvent.StartsWith('(') && keyEvent.EndsWith(")")) { eventBuilder.ClickChord(ParseChord(keyEvent)); } else { eventBuilder.Click(keyEvent.Trim('\'')); } } eventBuilder.Invoke(); }