Пример #1
0
        public DirectInputThumbSticks(DirectInputGamepad parentDevice)
        {
            ParentDevice = parentDevice;

            NumberOfThumbSticks = Math.Min(parentDevice.RawDevice.Caps.NumberAxes / 2, 3);

            //Debug.WriteLine("_NumberOfThumbSticks: " + _NumberOfThumbSticks);

            _Positions = new Vector2[NumberOfThumbSticks];

#if DEBUG
            _RawPositions = new Vector2[NumberOfThumbSticks];
#endif

            _DeadzoneThresholds_Range0to1_4 = new float[NumberOfThumbSticks];
            for (int i = 0; i < NumberOfThumbSticks; i++)
            {
                _DeadzoneThresholds_Range0to1_4[i] = DEFAULT_DEADZONE_THRESHOLD;
            }

            if (NumberOfThumbSticks > 0)
            {
                HasLeft = true;

                if (NumberOfThumbSticks > 1)
                {
                    HasRight = true;

                    if (NumberOfThumbSticks > 2)
                    {
                        HasThird = true;
                    }
                }
            }
        }
Пример #2
0
        public DirectInputButtons(DirectInputGamepad parentDevice)
        {
            ParentDevice = parentDevice;

            _NumberOfButtons = ParentDevice.RawDevice.Caps.NumberButtons;

            _ButtonsStates = new ButtonState[_NumberOfButtons];
        }
Пример #3
0
        public DirectInputDPad(DirectInputGamepad parentDevice, byte index)
        {
            ParentDevice = parentDevice;

            Index = index;
        }