From: Tyson Whitehead twhitehead@gmail.com
--- dlls/joy.cpl/dinput.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/dlls/joy.cpl/dinput.c b/dlls/joy.cpl/dinput.c index 067a9855cd0..e12b6a8ad25 100644 --- a/dlls/joy.cpl/dinput.c +++ b/dlls/joy.cpl/dinput.c @@ -233,6 +233,14 @@ static BOOL CALLBACK enum_devices( const DIDEVICEINSTANCEW *instance, void *cont { IDirectInput8W *dinput = context; struct device *entry; + DIPROPDWORD ac_prop = { + .diph = { + .dwSize = sizeof(DIPROPDWORD), + .dwHeaderSize = sizeof(DIPROPHEADER), + .dwHow = DIPH_DEVICE, + }, + .dwData = DIPROPAUTOCENTER_OFF, + }; HRESULT hr;
if (!(entry = calloc( 1, sizeof(*entry) ))) return DIENUM_STOP; @@ -241,6 +249,8 @@ static BOOL CALLBACK enum_devices( const DIDEVICEINSTANCEW *instance, void *cont if ( SUCCEEDED(hr) ) hr = IDirectInputDevice8_SetDataFormat( entry->device, &c_dfDIJoystick2 ); if ( SUCCEEDED(hr) ) hr = IDirectInputDevice8_SetCooperativeLevel( entry->device, GetAncestor( dialog_hwnd, GA_ROOT ), DISCL_BACKGROUND | DISCL_EXCLUSIVE ); + if ( SUCCEEDED(hr) ) IDirectInputDevice8_SetProperty( entry->device, DIPROP_AUTOCENTER, &ac_prop.diph ); + if ( SUCCEEDED(hr) ) list_add_tail( &devices, &entry->entry ); else WARN( "Skipping device '%s' due to API failure, hr = %#lx\n", debugstr_w(instance->tszInstanceName), hr );