Writing Joystick Code: Part 4: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
No edit summary
mNo edit summary
Line 11: Line 11:




This 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.
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 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
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
   <axis>
   <axis>
     <win>0</win>
     <win>0</win>
Line 30: Line 30:




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 change.
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, please post the information [http://flightgear.org/forums/viewtopic.php?f=24&t=17924 here].
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 [http://flightgear.org/forums/viewtopic.php?f=24&t=17924 here]. Don't post the axis number as they are currently in the xml file, we already know them.




224

edits

Navigation menu