Enabling/Disabling Joysticks from registry for the Mac

DavidL david.dljunk at gmail.com
Sat Jul 30 02:15:18 CDT 2016


Hi Ken,

I was looking into how the Linux-dinput code and joy.cpl work and comparing
that to the macOS-dinput code. I have some questions about how best to
proceed:

joy.cpl uses joy->instance.tszInstanceName to name the joysticks in the
control panel. In Linux-dinput code, they pass
the joystick_devices[id].name to both tszInstanceName and tszProductName
In the macOS-dinput code, they pass the name "Joystick #" where # is the
index in the joystick array to the instance name and the joystick's actual
name to the product name. When looking at the Microsoft guidelines for
dinput, it does indeed say that the instance name *can* be joystick +
position in the array, but doesn't specify that it *has* to be (
https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.dideviceinstance(v=vs.85).aspx).
Also, I've confirmed that in the Windows 10 joystick control panel the
joysticks are listed by their name, not by joystick number (and in my
memory of earlier Windows OSes it's the same).

So, should I change the macOS-dinput code to set both tszInstanceName
and tszProductName to the product name (as in Linux) or should I change
joy.cpl to use tszProductName instead of tszInstanceName? This will also
make it easier in the registry to know which joystick is being
enabled/disabled.

Further, while joy.cpl correctly is a dinput control panel,
enabling/disabling joystick should be for both dinput and winmm games -
e.g. X-wing vs Tie Fighter even has the joystick control panel in the
game's loader window*, but, once in the game, joystick control is handled
by winmm. I believe the joystick registry entry is under dinput, but the
winmm wine joystick driver should read that as well.

Is it acceptable for wine joystick driver to read the dinput registry? Or
should two registry entries be created? or should a single general joystick
registry entry not under dinput or winmm control both?

I may have more questions, but we'll start off with these. :)

Cheers,
David

*Interestingly, the game's sequel X-wing: Alliance says I need to install
DirectX to access joystick options in the loader window. I'm not sure why
the older title brings up the joystick control panel just fine, but the
later one does not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20160730/e02ad78f/attachment.html>


More information about the wine-devel mailing list