Skip to content

Commit

Permalink
fix:xinput disconnect lost gamepad (#15819)
Browse files Browse the repository at this point in the history
Co-authored-by: ChenX <maple6@vip.qq.com>
  • Loading branch information
FishOrBear and ChenX authored Oct 24, 2023
1 parent 57e9a3e commit 7df3ca3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions input/drivers_joypad/xinput_hybrid_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ static BOOL CALLBACK enum_joypad_cb_hybrid(
if (g_joypad_cnt == MAX_USERS)
return DIENUM_STOP;

while (!g_xinput_states[g_last_xinput_pad_idx].connected && g_last_xinput_pad_idx < 3)
{
g_last_xinput_pad_idx++;
}

pad = &g_pads[g_joypad_cnt].joypad;

#ifdef __cplusplus
Expand Down

0 comments on commit 7df3ca3

Please sign in to comment.