To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

Writing Joystick Code: Part 4

Work in progressThis article or section will be worked on in the upcoming hours or days. See history for the latest developments.

Axis Numbering

Until now we have got our joysticks working in our system by defining each axis with the following format

<axisn="0"><desc>Aileron</desc><binding>
...
</axis>

This is fine if you are using the joystick on your system. But imagine that you have worked out a brilliant button assignment scheme, using modifiers, so that the joystick is a joy to use. You want to post your code in the forum so everyone can use it.

There's a problem though. Different operating systems assign different numbers to the axes. Let's say that with a your joystick, Windows says that the Aileron axis is number 0, and Macs and Linux say it is axis 2. We have to change our format of the axis definition to

Except!! Sometimes an axis works upside down in some operating systems. Here is an example of what to do if the hat works opposite ways
in Linux and Windows. Note the swapping around of - signs between the 2 OSs. Add <mac> to which ever one is correct for the Mac.

Unfortunately, there is no fixed relationship between axis numbering in the operating systems, and the information must be garnered form experience. Fortunately, the button numbering doesn't seem to change.

Here is a list of axis numbers for various joysticks. The list will be expanded as and when I get the required information. If you have axis numbers for a joystick not listed here, please post the information here. Don't post the axis number as they are currently in the xml file, we already know them.