winejoystick.drv: Add axis remapping support

Vitaliy Margolen wine-devel at
Thu Feb 28 09:28:32 CST 2008

Adolfo R. Brandes wrote:
> Hi there,
> On Wed, Feb 27, 2008 at 3:44 PM, Vitaliy Margolen
> <wine-devel at> wrote:
>>  Don't do that. Keep it uniform. As-is it's a pain to configure. You want to
>>  introduce even more?
>  Actually, this was my shot at improving that particular aspect of
> the configuration.  As it is in dinput/joystick_linux.c, it's a bit of
> a shot in the dark as to what is "Slider1", "Slider2", and so on.  The
> way I did it, you can run jstest to find out what each of your axes
> are named, and use those names in regedit.
>  I realize this introduces confusion.  It's just that I think the
> previous standard requires a bit of a revision, in that there should
> be a more reliable way of determining what each axis in your joystick
> is called (and what wine expects it to be called).  Maybe
> joystick_linux should be patched too?

I'm not sure I like this. The names dinput joystick uses are the names 
windows uses in number of place. Also they are mentioned on MSDN and part of 
the API. Also for backwards compatibility if you change dinput joystick that 
means it will break all current configurations.

Not that I like the way it's done now. But it needs to be part of the 
winecfg for example. Then it wouldn't matter what we use internally.

>>  Disabling axis might not be a bad thing, especially for testing. I don't
>>  think you need to worry about extra axis on the device that are not mapped
>>  to anything.
>  I was worried about having two (or more) linux axes mapped to the
> same wine one.  That's the reason behind the fatal error.
Then you check for that particular case.

>> Also what about multiple POVs? Here you checking for only one.
>  It seems that the only pertinent JOYINFOEX constants from mmsystem.h
> "JOY_RETURNPOV2". I'm assuming that more hats simply won't register.
> Bear with me, everything I know about the Windows joystick API has
> been gathered from reading this driver, and it seems like there's a
> fundamental difference between DirectInput devices and "regular" ones.
>  Correct me if I'm wrong, but it looks to me like multiple POVs (or
> more than 6 axes) aren't supported here.

Yeah it seems the old interface does not support more then one POV. Sorry 
missed that.

>>  Now that you can remap axis it's not guaranteed that 6th axes is the speed
>>  and so on.
>  Yes, that's correct.  I previously tried a different approach,
> basing the selection of x, y, z, r, u, and v on what the axis is
> actually named (i.e., "Throttle" = z, "Rudder" = r), but that actually
> moots the whole point.  It turns out that it doesn't matter what the
> axis' nominal function is; what matters is the order in which they
> appear.  For instance, my joystick's rudder is actually named "Rz",
> which would wrongly map to "v" (as opposed to "r").  What's important
> is not for wine to know the difference between "Throttle" and
> "Rudder", but for the user to know what each axis is named and in what
> order they are presented to the application, so that he can then
> reoder them as he pleases.
I see, then you should also check for any gaps in mapping. If user skipped 
one axes it won't work.


More information about the wine-devel mailing list