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

[html5] gamepad disconnect event is never dispatched #1806

Open
bkhtrv opened this issue Jun 22, 2024 · 0 comments
Open

[html5] gamepad disconnect event is never dispatched #1806

bkhtrv opened this issue Jun 22, 2024 · 0 comments

Comments

@bkhtrv
Copy link

bkhtrv commented Jun 22, 2024

updateGameDevices() in lime/_internal/backend/html5/HTML5Application.hx prevents the event from happening

the

  cache.connected = false;
  
  Joystick.__disconnect(id);
  Gamepad.__disconnect(id);

part never happens because of if (data == null) continue

a dirty fix replacing

if (data == null) continue

with

if (data == null)
{
    if (gameDeviceCache.exists(id))
    {
        gameDeviceCache.remove(id);
        Joystick.__disconnect(id);
        Gamepad.__disconnect(id);
    }
    continue;
}

solved the issue for me

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

No branches or pull requests

1 participant