Writing Joystick Code: Part 4: Difference between revisions

no edit summary
mNo edit summary
No edit summary
Line 16: Line 16:
   <axis>
   <axis>
     <number>
     <number>
       <win>0</win>
       <windows>0</win>
       <mac>2</mac>
       <mac>2</mac>
       <unix>2</unix>
       <unix>2</unix>
Line 28: Line 28:


Now the joystick will work with all operating systems.
Now the joystick will work with all operating systems.
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.
  <axis>
    <number>
      <unix>6</unix>
    </number>
    <desc>View Elevation</desc>
    <low>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property>/sim/current-view/goal-pitch-offset-deg</property>
        <step type="double">1.0</step>
      </binding>
    </low>
    <high>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property>/sim/current-view/goal-pitch-offset-deg</property>
        <step type="double">-1.0</step>
      </binding>
    </high>
  </axis>
  <axis>
    <number>
      <windows>7</windows>
    </number>
    <desc>View Elevation</desc>
    <low>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property>/sim/current-view/goal-pitch-offset-deg</property>
        <step type="double">-1.0</step>
      </binding>
    </low>
    <high>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property>/sim/current-view/goal-pitch-offset-deg</property>
        <step type="double">1.0</step>
      </binding>
    </high>
  </axis>




Line 61: Line 109:
   Top Stick Hat                win ?  unix 8  mac 8
   Top Stick Hat                win ?  unix 8  mac 8
   
   
   I have listed this because the mac axis numbers are newly available'
   I have listed this because the Mac axis numbers are newly available'
   As you can see, win numbers still missing. The ones I have are just a guess.
   As you can see, win numbers still missing. The ones I have are just a guess.
--------------------------------------------------
--------------------------------------------------
224

edits