Exemplo n.º 1
0
        private void SetButton(IVirtualGamepad gamepad, Mapping mapping, bool isKeyDown)
        {
            uint button       = (uint)mapping.Function;
            bool currentValue = gamepad.GetButtonState(button);
            bool newValue     = isKeyDown;

            if (currentValue == newValue)
            {
                return;
            }

            gamepad.SetButtonState(button, newValue);
        }
Exemplo n.º 2
0
        private string SetButton(IVirtualGamepad gamepad, Mapping mapping, bool isKeyDown)
        {
            uint button       = (uint)mapping.Function;
            bool currentValue = gamepad.GetButtonState(button);
            bool newValue     = isKeyDown;

            if (currentValue == newValue)
            {
                return(null);
            }

            gamepad.SetButtonState(button, newValue);
            return(((XinputButton)button).ToString());
        }