Пример #1
0
        public XInputState GetControllerState(uint controllerId)
        {
            var result   = new XInputState();
            var opResult = XInputInvoker.XInputGetState(controllerId, ref result);

            switch (opResult)
            {
            case XInputOpResult.Success:
                return(result);

            case XInputOpResult.Error_DeviceNotConnected:
                throw new TurboXInputException(TurboXInputExceptionCode.DeviceNotConnected);

            default:
                throw new TurboXInputException(TurboXInputExceptionCode.UnexpectedError, "Error Code: " + opResult.ToString());
            }
        }
Пример #2
0
 public static extern XInputOpResult XInputGetState(uint dwUserIndex, ref XInputState pState);