/// <summary>Called when a button on the gamepad has been released</summary> /// <param name="button">Button that has been released</param> public void InjectButtonRelease(Buttons button) { if ((_heldButtons & button) == 0) { return; } _heldButtons &= ~button; // If a control signed responsible for the earlier button press, it will now // receive the release notification. _activatedControl?.ProcessButtonRelease(button); // Reset the activated control if the user has released all buttons on all // input devices. if (!AnyKeysOrButtonsPressed) { _activatedControl = null; } }