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); }
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()); }