On Thu Aug 14 15:00:16 2025 +0000, Paul Gofman wrote:
- adds an `Autocenter` registry app key that lets the default
`DIPROP_AUTOCENTER` setting to be set on a per device and per application and device level, FWIW per application management is usually a no-go in Wine, that is not something which can be supported. How does it work on Windows, are there any per-application profiles? I wasn't following the details, but can imagine that some backend limitations may justify certain per-device quirks, in that case those should be probably embedded in the code or pre-populated registry entries?
I had assumed the initial value was always on, and hardcoded that in the code. Never though more about it until Tomasz said the setting was a driver thing and not a dinput thing and the sim racing community where having problems with autocenter being on on their devices. No idea if he had just concluded it must be a driver setting and not dinput or actually knew.
I plugged the Sidewinder 2 in under Windows and checked the driver and driver details under the control panel. It just shows _HID-compliant game controller_ and _USB Input Device_. The inf file is `input.inf` and the section is `HID_Raw_Inst.NT` matched on `HID_DEVICE_SYSTEM_GAME`. The instance path contained `VID_045E&PID_001B` so I searched the registry for that and `sidewinder`. Got hits (keys and subkeys) under `HKEY_USERS...` under * _System\CurrentControlSet\Control\MediaProperties\PrivateProperties\DirectInput\VID_045E&PID_001B_ * _System\CurrentControlSet\Control\MediaProperties\PrivateProperties\Joystick\OEM\VID_045E&PID_001B_ * _System\CurrentControlSet\Control\MediaResources\Joystick\DINPUT.DLL\JoystickSettings\VID_045E&PID_001B_ * _System\CurrentControlSet\Control\MediaResources\Joystick\DINPUT.DLL\CurrentJoystickSettings_
Here is a [complete dump](/uploads/5b8cfcab20a990d63904b29fd04af15f/user_registry.txt) for anyone interested in what the key, subkeys, and value are. Nothing really stands out to me.
With regard to application specific keys, I was initially thinking environment variable, so I poked around and grepped through the wine tree to see how things were done. Didn't seem nearly as popular as with proton, so I checked how the input backend options (SDL, udev input, or udev hidram) were done and discovered the [`app_key` routines](https://gitlab.winehq.org/wine/wine/-/blob/b822e25ed2d52c53df7d9474defc7b704...) ``` BOOL get_app_key(HKEY *defkey, HKEY *appkey) DWORD get_config_key( HKEY defkey, HKEY appkey, const WCHAR *name, WCHAR *buffer, DWORD size ) ``` Figured I should just use what was already there for consistency, and it was the least amount of code, so that is where that came from. For what it is worth, grepping for `app_key` shows it in use in the [unix loader code for dlloverrides](https://gitlab.winehq.org/wine/wine/-/blob/b822e25ed2d52c53df7d9474defc7b704...) too.
I expect the application specific bit will never get used and at most the global default might get set using the conrol panel `joy.cpl` (Game Controllers) application. Especially as under proton (where it will probably used the most) wine prefixes are generally per-application anyway. Or maybe it won't even be used at all now that this merge request switches the default to on only for classic joysticks and not sim specific hardware like wheels, yokes, etc. Although the udev input backend doesn't do a good classification job, so could see some use there.
Anyway, not at all attached to this way beyond having already written the code, and can change to something else if that is what is required. Just let me know what that something else is.