Exemplo n.º 1
0
        public virtual void HandleKey(ConsoleKeyInfo keyInfo)
        {
            var servoIncrement = TimeSpan.FromMilliseconds(10);

            switch (keyInfo.KeyChar)
            {
            case '1':
                _controller.ServoSettleTime = _controller.ServoSettleTime.Add(servoIncrement);
                break;

            case '2':
                if (_controller.ServoSettleTime > servoIncrement)
                {
                    _controller.ServoSettleTime = _controller.ServoSettleTime.Add(-servoIncrement);
                }
                break;

            default:
                _keyHandler?.HandleKeyPress(keyInfo.KeyChar);
                break;
            }
        }