Esempio n. 1
0
 private void Push(DPadCommand dPadCommand, int delay1, int delay2)
 {
     MoveHat(dPadCommand);
     Thread.Sleep(delay1);
     MoveHat(DPadCommand.Center);
     Thread.Sleep(delay2);
 }
        public static void PressAndRelease(this ISwitchController controller, DPadCommand dPad, int duration, int wait = 0)
        {
            if (controller == null)
            {
                throw new ArgumentNullException(nameof(controller));
            }

            controller.PressDPad(dPad);
            Thread.Sleep(duration);
            controller.ReleaseDPad();
            Thread.Sleep(wait);
        }
Esempio n. 3
0
 private void MoveHat(DPadCommand command)
 {
     WriteSerialPort(new[] { (byte)ControlType.DPad, (byte)command, });
 }
Esempio n. 4
0
 public void PressDPad(DPadCommand dPad)
 {
     WriteSerialPort(new[] { (byte)ControlType.DPad, (byte)dPad, });
 }