Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger deactivate event for virtual gamepad #7711

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

StephenCWills
Copy link
Member

This PR resolves an issue reported by Discord user Ensl:

So I noticed When I enter a new level on the dev app sometimes there's an issue with the button interface and it causes the directional stick or the spell button to get "stuck" and spam spells or render movement inoperable.

Prior to #7513, the loading screens would call FetchMessage() in interface_msg_pump() to process events whenever the loading bar updates. FetchMessage() would delegate the event to the virtual gamepad event handler, meaning that SDL_FINGERUP events that occur during the loading screen would still be handled.

Now, with the async loading implementation, we are explicitly bypassing FetchMessage() and calling SDL_PollEvent() directly. This means the virtual gamepad event handlers aren't handling those finger up events.

// We use the real `SDL_PollEvent` here instead of `FetchEvent`
// to process real events rather than the recorded ones in demo mode.
while (SDL_PollEvent(&event)) {

Rather than relying on the user to remove their finger from the screen during the loading sequence, I figured it would make more sense to go ahead and reset the event handler state the same way we do for d-pad and button state when calling DeactivateVirtualGamepad().

Copy link
Collaborator

@glebm glebm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants