Writing Joystick Code: Part 3: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 327: Line 327:


Disadvantages:
Disadvantages:
Mode is not accessable from another xml file, such as for the rudder.
Complicated code needed to declare the variable.




Line 358: Line 358:


Advantages:  
Advantages:  
Mode is available from any xml file, so you can make the rudders behave according to its value.
Variable is easy to create.


Disadvantages:
Disadvantages:
You have to have at <nowiki>--prop:</nowiki> in the command line.
You have to have at <nowiki>--prop:</nowiki> in the command line.
You need to choos a better name than ''mode'' to avoid possible conflicts.
You can't type <nowiki>--prop:</nowiki> in the comments section at the top of your file, because of the consecutive minus signs. You have to type &amp;minus;&amp;minus;prop:  
You can't type <nowiki>--prop:</nowiki> in the comments section at the top of your file, because of the consecutive minus signs. You have to type &amp;minus;&amp;minus;prop:
 
 
Whichever method you use, choose a better name than ''mode'' for your variable. It is too common a word and may well one day be used somewhere in the system files. In the xml file for the Saitek Yoke, where I use a variable to control the assignments of the levers on the quadrant, I call the variable ''SaitekMultiMode''. Unlikely to be used by the FG programmers.
 


-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
224

edits