Beispiel #1
0
        static void Main(string[] args)
        {
            var mc = new MouseControllerService();
            var mr = new MouseRecorderService(mc, 1);

            Console.WriteLine("Press any key to start recording mouse movements.");
            Console.ReadKey();
            Console.WriteLine("Press any key to stop recording mouse movements.");
            mr.StartRecording(() => Console.KeyAvailable);

            Console.WriteLine("Press any key to play the recorded mouse positions.");
            Console.ReadKey();
            Console.WriteLine("Press any key to stop playing the recorded mouse positions.");
            var rec = mr.Recordings.First();

            mr.PlaybackRecording(rec, () => Console.KeyAvailable);
        }
Beispiel #2
0
 public StateContext(MouseRecorderService mouseRecorder)
 {
     Recorder           = mouseRecorder;
     EnterCancellation  = new CancellationTokenSource();
     EscapeCancellation = new CancellationTokenSource();
 }