Writing Joystick Code: Part 1: Difference between revisions

Jump to navigation Jump to search
m
Use Geshi line numbering and styling
m (WIP template)
m (Use Geshi line numbering and styling)
Line 11: Line 11:
Here is some code to explain a few important basic concepts of xml files. (I have numbered the lines to aid the explanation below. In your xml file the line numbers will not be there.)
Here is some code to explain a few important basic concepts of xml files. (I have numbered the lines to aid the explanation below. In your xml file the line numbers will not be there.)


  1  <button n="4">
<syntaxhighlight lang="xml" line>
   2    <desc>Gear up</desc>
<button n="4">
   3    <repeatable>false</repeatable>
   <desc>Gear up</desc>
   4    <binding>
   <repeatable>false</repeatable>
  5      <command>nasal</command>
   <binding>
  6      <script>controls.gearDown(-1)</script>
    <command>nasal</command>
   7    </binding>
    <script>controls.gearDown(-1)</script>
   8    <mod-up>
   </binding>
  9      <binding>
   <mod-up>
10        <command>nasal</command>
    <binding>
11        <script>controls.gearDown(0)</script>
      <command>nasal</command>
12      </binding>
      <script>controls.gearDown(0)</script>
13    </mod-up>
    </binding>
14  </button>
  </mod-up>
</button>
</syntaxhighlight>


Ignoring the actual meaning of the code, let's got through it line by line.
Ignoring the actual meaning of the code, let's got through it line by line.
Line 49: Line 51:


Line 14: </button> The end of the button section. Not necessary to specify the button number again, as you can't use <button> </button> inside another <button> </button> section.
Line 14: </button> The end of the button section. Not necessary to specify the button number again, as you can't use <button> </button> inside another <button> </button> section.


== Axes ==
== Axes ==

Navigation menu