From e8b5b4881c8eb31bb7de5adef3479305a73fb0bf Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 2 Jun 2023 09:38:18 -0700 Subject: [PATCH] Fixed WGI immediately being correlated with raw input devices with no input The at rest match state is 0x0000008800000000, not 0 --- src/joystick/windows/SDL_rawinputjoystick.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c index f8414c409..af5ed92f4 100644 --- a/src/joystick/windows/SDL_rawinputjoystick.c +++ b/src/joystick/windows/SDL_rawinputjoystick.c @@ -1075,6 +1075,7 @@ static int RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index) ctx->is_xinput = device->is_xinput; ctx->is_xboxone = device->is_xboxone; + ctx->match_state = 0x0000008800000000ULL; /* Trigger axes at rest */ ctx->preparsed_data = device->preparsed_data; ctx->max_data_length = SDL_HidP_MaxDataListLength(HidP_Input, ctx->preparsed_data); ctx->data = (HIDP_DATA *)SDL_malloc(ctx->max_data_length * sizeof(*ctx->data));