public StickState(XBoxController controller, StickType type) { _controller = controller; _stickType = type; _previosValue = new Point(0, 0); _controller.StateChanged += _controller_StateChanged; }
public static void MoveAndRelease(this ISwitchController controller, StickType stick, byte x, byte y, int duration, int wait = 0) { if (controller == null) { throw new ArgumentNullException(nameof(controller)); } controller.MoveStick(stick, x, y); Thread.Sleep(duration); controller.ReleaseStick(stick); Thread.Sleep(wait); }
public void ReleaseStick(StickType stick) { const byte Center = 128; MoveStick(stick, Center, Center); }
public void MoveStick(StickType stick, byte x, byte y) { WriteSerialPort(new[] { (byte)ControlType.Stick, (byte)stick, x, y, }); }