Ejemplo 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);
        }
Ejemplo n.º 3
0
 private void MoveHat(DPadCommand command)
 {
     WriteSerialPort(new[] { (byte)ControlType.DPad, (byte)command, });
 }
Ejemplo n.º 4
0
 public void PressDPad(DPadCommand dPad)
 {
     WriteSerialPort(new[] { (byte)ControlType.DPad, (byte)dPad, });
 }