Difference between revisions of "Manual:Config:Advanced:Bindings:Joystick"

From VsWiki
Jump to: navigation, search
(Added info about joystick probing.)
(Added config settings for Xbox 360 controller.)
 
(22 intermediate revisions by 16 users not shown)
Line 1: Line 1:
 +
{{Languages|En|Manual:Config:Advanced:Bindings:Joystick}}
 
{{NAV_Manual |
 
{{NAV_Manual |
 
| previous=[[Manual:Config:Advanced:Bindings:Mouse|Config:Advanced:Bindings:Mouse]]
 
| previous=[[Manual:Config:Advanced:Bindings:Mouse|Config:Advanced:Bindings:Mouse]]
Line 8: Line 9:
 
==Joystick Configuration==
 
==Joystick Configuration==
  
This page provides working examples of different joystick configurations, showing how each buton has been bound to operate a single Vega Strike function.
+
This page provides working examples of different joystick configurations, showing how each button has been bound to operate a single Vega Strike function.
  
 
If a Joystick Configuration matches your joystick, you can edit copy the configuration here into your vegastrike config file.
 
If a Joystick Configuration matches your joystick, you can edit copy the configuration here into your vegastrike config file.
Line 21: Line 22:
 
====Description====
 
====Description====
 
* <code>joystick</code> - Number of the joystick.
 
* <code>joystick</code> - Number of the joystick.
* <code>player</code> - for which player is the command specified? {{Fixme}} ?how this is right?
+
* <code>player</code> - for which player is the command specified? (this is useful when you have more than one joystick that you wish to configure for the same user)
 
* <code>button</code> - Number of the button on the joystick.
 
* <code>button</code> - Number of the button on the joystick.
 
* <code>modifier</code> - {{Fixme}} ''? no clue ?''
 
* <code>modifier</code> - {{Fixme}} ''? no clue ?''
Line 40: Line 41:
  
 
===ANALOG COOLIHAT/HATSWITCH===
 
===ANALOG COOLIHAT/HATSWITCH===
[http://vegastrike.sourceforge.net/forums/viewtopic.php?p=17017#17017 forum link 1]
+
[http://forums.vega-strike.org/viewtopic.php?p=17017#17017 forum link 1]
  
 
====Sample====
 
====Sample====
Line 58: Line 59:
  
 
Once defined, analog hatswitches have their own number, and their "buttons" (positions) are defined independently of joysticks.  When creating your <nowiki><bind></nowiki> tags, make sure you do not specify a joystick number (e.g. ''joystick="0"''); this will bind buttons on the joystick rather than positions on the hatswitch.
 
Once defined, analog hatswitches have their own number, and their "buttons" (positions) are defined independently of joysticks.  When creating your <nowiki><bind></nowiki> tags, make sure you do not specify a joystick number (e.g. ''joystick="0"''); this will bind buttons on the joystick rather than positions on the hatswitch.
 
'' '''Note:''' Analog hatswitch support is not working as of the Vega Strike 0.4.3 release.  This has been fixed in the CVS tree as of 2005-07-30.  To add analog hatswitch support to Vega Strike 0.4.3, check out the "vegastrike_0_4_3" tag, then update the "in_sdl.cpp" file to CVS version 1.30.''
 
  
 
===DIGITAL COOLIHAT/HATSWITCH===
 
===DIGITAL COOLIHAT/HATSWITCH===
[http://vegastrike.sourceforge.net/forums/viewtopic.php?p=17017#17017 forum link]
+
[http://forums.vega-strike.org/viewtopic.php?p=17017#17017 forum link]
  
 
====Sample====
 
====Sample====
Line 75: Line 74:
 
**Possible values: "center", "up", "right", "left", "down", "rightup", "rightdown", "leftup", "leftdown"
 
**Possible values: "center", "up", "right", "left", "down", "rightup", "rightdown", "leftup", "leftdown"
 
* <code>command</code> - Specify the command to start when the button is pressed here. See [[Manual:Keyboard layout|Keyboard layout]] for description and a list of commands.
 
* <code>command</code> - Specify the command to start when the button is pressed here. See [[Manual:Keyboard layout|Keyboard layout]] for description and a list of commands.
 +
 +
'' '''Note:''' Digital hatswitches will "chord".  If you supply commands for "left", "up", and "leftup", moving the hatswitch to the upper left will activate all three commands.''
 +
 +
'' '''Note (2):''' Digital hatswitch support is disabled by default in the CVS tree.  To enable it, edit your vegastrike.config and set "debug_digital_hatswitch" to "true".  Be warned that this will send lots of debugging text to the console.  Also, you cannot currently bind commands to "center".  Both bugs have been submitted with a patch and may be resolved soon.''
 +
  
 
===DIGITAL AXES/D-PAD AS HATSWITCH===
 
===DIGITAL AXES/D-PAD AS HATSWITCH===
Line 107: Line 111:
  
 
==Joystick Examples==
 
==Joystick Examples==
Please insert your working configs here
+
'''Please insert your working configs here.'''
  
 
=== Microsoft SideWinder Force Feedback Pro ===
 
=== Microsoft SideWinder Force Feedback Pro ===
Line 135: Line 139:
  
 
==== Binding code ====
 
==== Binding code ====
Place the code below above the <code></bindings></code> line in the <code>vegastrike.config</code> file.
+
Place the code below above the <code></bindings></code> line in the <code>vegastrike.config</code> file. If you modify it, be sure not to include comments between vssetup makers (#joy_ffp and #end), as that will break it.
  
 
{{Fixme}} ''Attention: This bindings may not work under linux ... at least it doesn't for me since i switched. Help is always welcome.''
 
{{Fixme}} ''Attention: This bindings may not work under linux ... at least it doesn't for me since i switched. Help is always welcome.''
 
<pre>
 
<pre>
<!-- #joy_ffp -->
 
 
<!-- Joystick:Microsoft SideWinder Force Feedback Pro:BEGIN-->
 
<!-- Joystick:Microsoft SideWinder Force Feedback Pro:BEGIN-->
 
<!-- buttons:BEGIN -->
 
<!-- buttons:BEGIN -->
 +
<!-- #joy_ffp -->
 
  <bind joystick="0" player="0" button="0" modifier="none" command="FireKey" />  <!-- stick:fire key -->
 
  <bind joystick="0" player="0" button="0" modifier="none" command="FireKey" />  <!-- stick:fire key -->
 
  <bind joystick="0" button="1" modifier="none" command="MissileKey" />          <!-- stick:left key -->
 
  <bind joystick="0" button="1" modifier="none" command="MissileKey" />          <!-- stick:left key -->
Line 152: Line 156:
 
  <bind joystick="0" button="8" modifier="none" command="SheltonKey" />          <!-- not used? -->
 
  <bind joystick="0" button="8" modifier="none" command="SheltonKey" />          <!-- not used? -->
 
  <bind joystick="0" button="9" modifier="none" command="DecelKey" />            <!-- socket:shift key -->
 
  <bind joystick="0" button="9" modifier="none" command="DecelKey" />            <!-- socket:shift key -->
 +
<!-- #end -->
 
<!-- buttons:END -->
 
<!-- buttons:END -->
  
 
<!-- axes:BEGIN -->
 
<!-- axes:BEGIN -->
 +
<!-- #joy_ffp -->
 
  <axis name="x"        joystick="0" axis="0" inverse="false" /> <!-- stick:left/right -->
 
  <axis name="x"        joystick="0" axis="0" inverse="false" /> <!-- stick:left/right -->
 
  <axis name="y"        joystick="0" axis="1" inverse="false" /> <!-- stick:up/down -->
 
  <axis name="y"        joystick="0" axis="1" inverse="false" /> <!-- stick:up/down -->
Line 166: Line 172:
 
   <hatswitch value="1.0"/>
 
   <hatswitch value="1.0"/>
 
  </axis>
 
  </axis>
<!-- axes:END -->
+
<!-- #end -->
 +
<!-- axes:END -->
  
 
<!-- throttle-bindings:BEGIN -->
 
<!-- throttle-bindings:BEGIN -->
 +
<!-- #joy_ffp -->
 
  <bind hatswitch="0" button="0" modifier="none" command="ABKey" />
 
  <bind hatswitch="0" button="0" modifier="none" command="ABKey" />
 
  <bind hatswitch="0" button="1" modifier="none" command="AccelKey" />
 
  <bind hatswitch="0" button="1" modifier="none" command="AccelKey" />
 
  <bind hatswitch="0" button="2" modifier="none" command="DecelKey" />
 
  <bind hatswitch="0" button="2" modifier="none" command="DecelKey" />
 
  <bind hatswitch="0" button="3" modifier="none" command="StopKey" />
 
  <bind hatswitch="0" button="3" modifier="none" command="StopKey" />
 +
<!-- #end -->
 
<!-- throttle-bindings:END -->
 
<!-- throttle-bindings:END -->
  
 
<!-- hatswitch:BEGIN -->
 
<!-- hatswitch:BEGIN -->
 +
<!-- #joy_ffp -->
 
  <bind joystick="0" digital-hatswitch="0" direction="up"    command="Cockpit::Inside"/>
 
  <bind joystick="0" digital-hatswitch="0" direction="up"    command="Cockpit::Inside"/>
 
  <bind joystick="0" digital-hatswitch="0" direction="left"  command="Cockpit::InsideLeft"/>
 
  <bind joystick="0" digital-hatswitch="0" direction="left"  command="Cockpit::InsideLeft"/>
Line 181: Line 191:
 
  <bind joystick="0" digital-hatswitch="0" direction="right"  command="Cockpit::InsideRight"/>
 
  <bind joystick="0" digital-hatswitch="0" direction="right"  command="Cockpit::InsideRight"/>
 
  <bind joystick="0" digital-hatswitch="0" direction="down"  command="Cockpit::InsideBack"/>
 
  <bind joystick="0" digital-hatswitch="0" direction="down"  command="Cockpit::InsideBack"/>
 +
<!-- #end -->
 
<!-- hatswitch:END -->
 
<!-- hatswitch:END -->
 
<!-- Joystick:Microsoft SideWinder Force Feedback Pro:END-->
 
<!-- Joystick:Microsoft SideWinder Force Feedback Pro:END-->
<!-- #end -->
 
 
</pre>
 
</pre>
  
=== Microsoft SideWinder Force Feedback 2 (USB) in Linux ===
+
=== Microsoft SideWinder Force Feedback 2 (USB) ===
 +
 
 +
==== Linux 2.4 ====
 +
:''(tested kernels: 2.4.27)''
  
 
This model shows up in Linux as having 11 axes and 20 buttons, but only nine buttons and six axes are used, two of which are for the pseudo-analog hatstick (which is really effectively digital).
 
This model shows up in Linux as having 11 axes and 20 buttons, but only nine buttons and six axes are used, two of which are for the pseudo-analog hatstick (which is really effectively digital).
Line 195: Line 208:
  
 
Once the myriad axes are out of the way, the buttons are exceedingly simple; the first eight buttons (0 through 7) map directly to the stick buttons.  Button #11 is a special virtual button that is "pressed" when the hand leaves the stick (via an optical sensor).  Docking at a space station is the most logical use for this "button", since that's when the user will want to let go of the joystick anyway; aside from saving a keypress, it's also good for amazing any onlookers with the user's "magic" joystick.
 
Once the myriad axes are out of the way, the buttons are exceedingly simple; the first eight buttons (0 through 7) map directly to the stick buttons.  Button #11 is a special virtual button that is "pressed" when the hand leaves the stick (via an optical sensor).  Docking at a space station is the most logical use for this "button", since that's when the user will want to let go of the joystick anyway; aside from saving a keypress, it's also good for amazing any onlookers with the user's "magic" joystick.
 +
 +
<pre>
 +
<!-- Trigger button (1) and labelled buttons 2 through 8, in order. -->
 +
<!-- #joy_ff2 -->
 +
  <bind joystick="0" player="0" button="0" modifier="none" command="FireKey" />
 +
  <bind joystick="0" button="1" modifier="none" command="MissileKey" />
 +
  <bind joystick="0" button="2" modifier="none" command="TargetKey" />
 +
  <bind joystick="0" button="3" modifier="none" command="PickTargetKey" />
 +
  <bind joystick="0" button="4" modifier="none" command="MisSelKey" />
 +
  <bind joystick="0" button="5" modifier="none" command="WeapSelKey" />
 +
  <bind joystick="0" button="6" modifier="none" command="SheltonKey" />
 +
  <bind joystick="0" button="7" modifier="none" command="ABKey" />
 +
<!-- #end -->
 +
 +
<!-- The special button triggered when the hand leaves the stick. -->
 +
<!-- #joy_ff2 -->
 +
  <bind joystick="0" button="11" modifier="none" command="DockKey" />
 +
<!-- #end -->
 +
 +
<!-- The axes aren't sequential; many are unused. -->
 +
<!-- #joy_ff2 -->
 +
  <axis joystick="0" axis="0" name="x" inverse="false" />
 +
  <axis joystick="0" axis="1" name="y" inverse="false" />
 +
  <axis joystick="0" axis="4" name="z" inverse="true" />
 +
  <axis joystick="0" axis="5" name="throttle" inverse="false" />
 +
<!-- #end -->
 +
 +
<!-- Hatswitch left-right movement. -->
 +
<!-- #joy_ff2 -->
 +
  <axis joystick="0" axis="6" name="hatswitch" nr="0" margin="0.5" inverse="false">
 +
    <hatswitch value="-1.0"/>
 +
    <hatswitch value="1.0"/>
 +
    <hatswitch value="0"/>
 +
  </axis>
 +
  <bind hatswitch="0" button="0" modifier="none" command="Cockpit::InsideLeft" />
 +
  <bind hatswitch="0" button="1" modifier="none" command="Cockpit::InsideRight"/>
 +
  <bind hatswitch="0" button="2" modifier="none" command="Cockpit::Inside" />
 +
<!-- #end -->
 +
 +
<!-- Hatswitch up-down movement. -->
 +
<!-- #joy_ff2 -->
 +
  <axis joystick="0" axis="7" name="hatswitch" nr="1" margin="0.5" inverse="false">
 +
    <hatswitch value="-1.0"/>
 +
    <hatswitch value="1.0"/>
 +
  </axis>
 +
  <bind hatswitch="1" button="0" modifier="none" command="Cockpit::Behind" />
 +
  <bind hatswitch="1" button="1" modifier="none" command="Cockpit::InsideBack" />
 +
<!-- #end -->
 +
</pre>
 +
 +
==== Linux 2.6 ====
 +
:''(tested kernels: 2.6.10, 2.6.11, 2.6.12)''
 +
 +
Things become much simpler in Linux 2.6.  The hatswitch is actually recognised as a digital hatswitch, and the virtual "hand off joystick" button becomes button 8, right after the eight physical buttons.  On the other hand, the throttle and twist axes numbers actually move to ''higher'' numbers.  Still, things get simpler overall.
 +
 +
The stick's reported properties vary greatly between kernel versions:
 +
* '''2.6.10:''' 18 axes, 15 buttons, 1 hat
 +
* '''2.6.12:''' 12 axes, 9 buttons, 1 hat
 +
Apparently, the device code is still being worked on, but it seems the detection is getting closer and closer to the truth.
 +
 +
Below is the exact same configuration as above, but adapted for the 2.6 series of kernels:
  
 
<pre>
 
<pre>
 
<!-- #joy_ff2 -->
 
<!-- #joy_ff2 -->
<!-- Trigger button (1) and labelled buttons 2 through 8, in order. -->
 
 
  <bind joystick="0" player="0" button="0" modifier="none" command="FireKey" />
 
  <bind joystick="0" player="0" button="0" modifier="none" command="FireKey" />
 
  <bind joystick="0" button="1" modifier="none" command="MissileKey" />
 
  <bind joystick="0" button="1" modifier="none" command="MissileKey" />
Line 207: Line 280:
 
  <bind joystick="0" button="6" modifier="none" command="SheltonKey" />
 
  <bind joystick="0" button="6" modifier="none" command="SheltonKey" />
 
  <bind joystick="0" button="7" modifier="none" command="ABKey" />
 
  <bind joystick="0" button="7" modifier="none" command="ABKey" />
<!-- The special button triggered when the hand leaves the stick. -->
+
  <bind joystick="0" button="8" modifier="none" command="DockKey" />
  <bind joystick="0" button="11" modifier="none" command="DockKey" />
 
  
<!-- The axes aren't sequential; many are unused. -->
 
 
  <axis joystick="0" axis="0" name="x" inverse="false" />
 
  <axis joystick="0" axis="0" name="x" inverse="false" />
 
  <axis joystick="0" axis="1" name="y" inverse="false" />
 
  <axis joystick="0" axis="1" name="y" inverse="false" />
  <axis joystick="0" axis="4" name="z" inverse="true" />
+
  <axis joystick="0" axis="5" name="z" inverse="true" />
  <axis joystick="0" axis="5" name="throttle" inverse="false" />
+
  <axis joystick="0" axis="6" name="throttle" inverse="false" />
 +
 
 +
<bind joystick="0" digital-hatswitch="0" direction="up" command="Cockpit::Behind"/>
 +
<bind joystick="0" digital-hatswitch="0" direction="down" command="Cockpit::InsideBack"/>
 +
<bind joystick="0" digital-hatswitch="0" direction="left" command="Cockpit::InsideLeft"/>
 +
<bind joystick="0" digital-hatswitch="0" direction="right" command="Cockpit::InsideRight"/>
 +
<bind joystick="0" digital-hatswitch="0" direction="center" command="Cockpit::Inside"/>
 +
<!-- #end -->
 +
</pre>
 +
 
 +
 
 +
=== Microsoft SideWinder Precision 2 (USB) ===
 +
Tested under Windows XP Home. Digital coolihat/hatswitch left un-assigned.
 +
 
 +
==== Add the joystick-name to the dropdown menu ====
 +
add <code>joy_msswp2</code>
 +
like this
 +
<pre>
 +
#cat Joystick no_joy joy_normal joy_throttle joy_axis joy_throttle_and_axis joy_t_a_rev joy_msswp2
 +
</pre>
 +
 
 +
==== Add the description text ====
 +
<pre>
 +
#desc joy_msswp2 Microsoft SideWinder Precision 2
 +
</pre>
 +
 
 +
==== Make the joystick the current one ====
 +
<pre>
 +
#set Joystick joy_msswp2
 +
</pre>
 +
 
 +
==== Binding code ====
 +
Place the code below above the <code></bindings></code> line in the <code>vegastrike.config</code> file.
  
<!-- Hatswitch left-right movement. -->
+
<pre>
<axis joystick="0" axis="6" name="hatswitch" nr="0" margin="0.5" inverse="false">
+
  <!-- Joystick:Microsoft SideWinder Precision 2:BEGIN-->
  <hatswitch value="-1.0"/>
+
      <!-- buttons:BEGIN -->
  <hatswitch value="1.0"/>
+
        <!-- #joy_msswp2 -->
  <hatswitch value="0"/>
+
        <bind joystick="0" player="0" button="0" modifier="none" command="FireKey" />
</axis>
+
        <bind joystick="0" button="1" modifier="none" command="MissileKey" />        
<bind hatswitch="0" button="0" modifier="none" command="Cockpit::InsideLeft" />
+
        <bind joystick="0" button="2" modifier="none" command="PickTargetKey" />      
<bind hatswitch="0" button="1" modifier="none" command="Cockpit::InsideRight"/>
+
        <bind joystick="0" button="3" modifier="none" command="LockTargetKey" />      
<bind hatswitch="0" button="2" modifier="none" command="Cockpit::Inside" />
+
        <bind joystick="0" button="4" modifier="none" command="TargetKey" />          
 +
        <bind joystick="0" button="5" modifier="none" command="MisSelKey" />          
 +
        <bind joystick="0" button="6" modifier="none" command="WeapSelKey" />        
 +
        <bind joystick="0" button="7" modifier="none" command="SheltonKey" />       
 +
        <!-- #end -->
 +
      <!-- buttons:END -->
 +
                       
 +
      <!-- axes:BEGIN -->
 +
        <!-- #joy_msswp2 -->
 +
        <axis name="x"        joystick="0" axis="0" inverse="false" />
 +
        <axis name="y"        joystick="0" axis="1" inverse="false" />
 +
        <axis name="z"        joystick="0" axis="3" inverse="true" /> 
 +
        <axis name="throttle" joystick="0" axis="2"/>
 +
        <!-- #end -->
 +
      <!-- axes:END -->
  
<!-- Hatswitch up-down movement. -->
+
  <!-- Joystick:Microsoft SideWinder Precision 2:END-->
<axis joystick="0" axis="7" name="hatswitch" nr="1" margin="0.5" inverse="false">
 
  <hatswitch value="-1.0"/>
 
  <hatswitch value="1.0"/>
 
</axis>
 
<bind hatswitch="1" button="0" modifier="none" command="Cockpit::Behind" />
 
<bind hatswitch="1" button="1" modifier="none" command="Cockpit::InsideBack" />
 
<!-- #end -->
 
 
</pre>
 
</pre>
  
Line 239: Line 349:
 
  4-axis/8-buttons/1-hatswitch stick + CH pedals on a gameport  
 
  4-axis/8-buttons/1-hatswitch stick + CH pedals on a gameport  
  
http://vegastrike.sourceforge.net/forums/viewtopic.php?p=12580#12580
+
http://forums.vega-strike.org/viewtopic.php?p=12580#12580
 
forum link
 
forum link
  
 
<pre>
 
<pre>
<!-- #joy_cyborg3d -->
 
 
<!-- Joystick:USB Saitek Cyborg 3D (4 axis 10 button 1 hatswitch):BEGIN -->
 
<!-- Joystick:USB Saitek Cyborg 3D (4 axis 10 button 1 hatswitch):BEGIN -->
 
<!-- buttons:BEGIN -->
 
<!-- buttons:BEGIN -->
 +
<!-- #joy_cyborg3d -->
 
   <bind joystick="1" player="0"  button="0" modifier="none" command="FireKey" />
 
   <bind joystick="1" player="0"  button="0" modifier="none" command="FireKey" />
 
   <bind joystick="1" button="1"  modifier="none" command="ABKey" />
 
   <bind joystick="1" button="1"  modifier="none" command="ABKey" />
Line 260: Line 370:
 
   <bind joystick="1" button="12" modifier="none" command="Cockpit::InsideRight" />
 
   <bind joystick="1" button="12" modifier="none" command="Cockpit::InsideRight" />
 
   <bind joystick="1" button="13" modifier="none" command="Cockpit::InsideBack" />
 
   <bind joystick="1" button="13" modifier="none" command="Cockpit::InsideBack" />
 +
<!-- #end -->
 
<!-- buttons:END -->
 
<!-- buttons:END -->
  
 
<!-- axes:BEGIN -->
 
<!-- axes:BEGIN -->
 +
<!-- #joy_cyborg3d -->
 
   <axis name="x" joystick="1" axis="0" inverse="false" />
 
   <axis name="x" joystick="1" axis="0" inverse="false" />
 
   <axis name="y" joystick="1" axis="1" inverse="false" />
 
   <axis name="y" joystick="1" axis="1" inverse="false" />
 
   <!-- <axis name="throttle" joystick="1" axis="2"/> -->
 
   <!-- <axis name="throttle" joystick="1" axis="2"/> -->
 +
<!-- #end -->
 
<!-- axes:END -->
 
<!-- axes:END -->
 
<!-- Joystick:USB Saitek Cyborg 3D (4 axis 10 button 1 hatswitch):END -->
 
<!-- Joystick:USB Saitek Cyborg 3D (4 axis 10 button 1 hatswitch):END -->
Line 271: Line 384:
 
<!-- gameport CH pedals:BEGIN -->
 
<!-- gameport CH pedals:BEGIN -->
 
<!-- axes:BEGIN -->
 
<!-- axes:BEGIN -->
 +
<!-- #joy_cyborg3d -->
 
   <axis name="z" joystick="0" axis="3" inverse="true"/>
 
   <axis name="z" joystick="0" axis="3" inverse="true"/>
 +
<!-- #end -->
 
<!-- axes:END -->
 
<!-- axes:END -->
 
<!-- gameport CH pedals:END -->
 
<!-- gameport CH pedals:END -->
<!-- #end -->
 
 
</pre>
 
</pre>
  
 +
=== USB Saitek Cyborg 3DII ===
 +
This config has only been tested on Linux, but it is likely to work elsewhere.
 +
 +
From: http://forums.vega-strike.org/viewtopic.php?t=8620 (GordonShomway)
 +
 +
I have an old Saitek Cyborg 3DII USB. When I configured the Joystick as "2 axis and throttle" or "3 axis (and throttle)", the throttle was on the z-axis and the twist on the leaver for the throttle.
 +
 +
In order to fix this I had to change the number of the axis' as follows:
 +
 +
throttle from 2 to 3.
 +
 +
Here is the configuration for "3 axis and throttle"
 +
<axis name="x" joystick="0" axis="0" inverse="false" />
 +
<axis name="y" joystick="0" axis="1" inverse="false" />
 +
<axis name="z" joystick="0" axis="2" inverse="false" />
 +
<axis name="throttle" joystick="0" axis="3" inverse="false" />
 +
 +
=== USB Saitek AV8R-01 ===
 +
4 axis/12 button/8-digital hatswitch/2 rotary control/dual throttle.
 +
 +
This is the configuration for pitch/roll on primary axes, yaw on "twist" control, and main throttle on left.
 +
<pre>
 +
<axis name="x" joystick="0" axis="3" inverse="false" />
 +
<axis name="y" joystick="0" axis="1" inverse="false" />
 +
<axis name="z" joystick="0" axis="0" inverse="true" />
 +
<axis name="throttle" joystick="0" axis="2" />
 +
</pre>
 +
 +
These are some good button controls
 +
<pre>
 +
<bind joystick="0" player="0" button="0" modifier="none" command="FireKey" />
 +
<bind joystick="0" button="1" modifier="none" command="MissileKey" />
 +
<bind joystick="0" button="2" modifier="none" command="NearestDangerousHostileKey" />
 +
<bind joystick="0" button="3" modifier="none" command="ABKey" />
 +
 +
<bind joystick="0" button="4" modifier="none" command="ThrustUp" />
 +
<bind joystick="0" button="5" modifier="none" command="ThrustDown" />
 +
 +
<bind joystick="0" button="6" modifier="none" command="MissionTargetKey" />
 +
<bind joystick="0" button="7" modifier="none" command="ThrustLeft" />
 +
 +
<bind joystick="0" button="8" modifier="none" command="SigTargetKey" />
 +
<bind joystick="0" button="9" modifier="none" command="ThrustRight" />
 +
 +
<bind joystick="0" button="10" modifier="none" command="Cockpit::SwitchLVDU" />
 +
<bind joystick="0" button="11" modifier="none" command="Cockpit::SwitchRVDU" />
 +
 +
<bind joystick="0" button="12" modifier="none" command="StopKey" />
 +
<bind joystick="0" button="13" modifier="none" command="" />
 +
</pre>
 +
 +
The following is a "sticky" hat control
 +
 +
<pre>
 +
<bind joystick="0" digital-hatswitch="0" direction="up" command="Cockpit::Inside"/>
 +
<bind joystick="0" digital-hatswitch="0" direction="left" command="Cockpit::InsideLeft"/>
 +
<bind joystick="0" digital-hatswitch="0" direction="right" command="Cockpit::InsideRight"/>
 +
<bind joystick="0" digital-hatswitch="0" direction="down" command="Cockpit::InsideBack"/>
 +
</pre>
 +
 +
Add this to make the hat control return to norma view after it is released
  
 +
<pre>
 +
  <bind joystick="0" digital-hatswitch="0" direction="center" command="Cockpit::NavScreen"/>
 +
</pre>
 +
 
=== USB Saitek X45 ===
 
=== USB Saitek X45 ===
 
  4-axis/7-button/4-hatswitch/2 rotary control, 2 mode switch (M1,M2,M3 and AUX0-1) stick/flight control system.
 
  4-axis/7-button/4-hatswitch/2 rotary control, 2 mode switch (M1,M2,M3 and AUX0-1) stick/flight control system.
Line 286: Line 465:
  
 
<pre>
 
<pre>
<!-- #joy_saitek_x45 -->
 
 
<!-- Joystick:USB Saitek X45 (4 axis, 7 buttons, 4 hatswitches):BEGIN -->
 
<!-- Joystick:USB Saitek X45 (4 axis, 7 buttons, 4 hatswitches):BEGIN -->
 
<!-- buttons:BEGIN -->
 
<!-- buttons:BEGIN -->
 +
    <!-- #joy_saitek_x45 -->
 
<bind joystick="0" player="0"  button="0" modifier="none" command="FireKey" />
 
<bind joystick="0" player="0"  button="0" modifier="none" command="FireKey" />
 
<bind joystick="0" button="3"  modifier="none" command="MissileKey" />
 
<bind joystick="0" button="3"  modifier="none" command="MissileKey" />
Line 296: Line 475:
 
<bind joystick="0" button="2"  modifier="none" command="SigTargetKey" />
 
<bind joystick="0" button="2"  modifier="none" command="SigTargetKey" />
 
<bind joystick="0" button="7"  modifier="none" command="NearestTargetKey" />
 
<bind joystick="0" button="7"  modifier="none" command="NearestTargetKey" />
 +
    <!-- #end -->
  
 
<!-- button 6 is originally intended as Shift button -->
 
<!-- button 6 is originally intended as Shift button -->
 
<!-- <bind joystick="0" button="6"  modifier="none" command="Cockpit::NavScreen" /> -->
 
<!-- <bind joystick="0" button="6"  modifier="none" command="Cockpit::NavScreen" /> -->
  
 +
    <!-- #joy_saitek_x45 -->
 
<bind joystick="0" button="8"  modifier="none" command="CloakKey" />
 
<bind joystick="0" button="8"  modifier="none" command="CloakKey" />
 
<bind joystick="0" button="9"  modifier="none" command="CloakKey" />
 
<bind joystick="0" button="9"  modifier="none" command="CloakKey" />
Line 307: Line 488:
 
<bind joystick="0" button="12" modifier="none" command="ToggleWarpDrive" />
 
<bind joystick="0" button="12" modifier="none" command="ToggleWarpDrive" />
 
<bind joystick="0" button="13" modifier="none" command="ToggleWarpDrive" />
 
<bind joystick="0" button="13" modifier="none" command="ToggleWarpDrive" />
 +
    <!-- #end -->
  
 
<!-- Joystick: HatSwitch 2 (left) -->
 
<!-- Joystick: HatSwitch 2 (left) -->
 +
    <!-- #joy_saitek_x45 -->
 
<bind joystick="0" button="14" modifier="none" command="WeapSelKey" />
 
<bind joystick="0" button="14" modifier="none" command="WeapSelKey" />
 
<bind joystick="0" button="15" modifier="none" command="MisSelKey" />
 
<bind joystick="0" button="15" modifier="none" command="MisSelKey" />
 
<bind joystick="0" button="16" modifier="none" command="ReverseWeapSelKey" />
 
<bind joystick="0" button="16" modifier="none" command="ReverseWeapSelKey" />
 
<bind joystick="0" button="17" modifier="none" command="ReverseMisSelKey" />
 
<bind joystick="0" button="17" modifier="none" command="ReverseMisSelKey" />
 +
    <!-- #end -->
  
 
<!-- ThrottleSystem: HatSwitch 3 (back)-->
 
<!-- ThrottleSystem: HatSwitch 3 (back)-->
 +
    <!-- #joy_saitek_x45 -->
 
<bind joystick="0" button="18" modifier="none" command="Cockpit::PitchDown" />
 
<bind joystick="0" button="18" modifier="none" command="Cockpit::PitchDown" />
 
<bind joystick="0" button="19" modifier="none" command="Cockpit::YawLeft" />
 
<bind joystick="0" button="19" modifier="none" command="Cockpit::YawLeft" />
 
<bind joystick="0" button="20" modifier="none" command="Cockpit::PitchUp" />
 
<bind joystick="0" button="20" modifier="none" command="Cockpit::PitchUp" />
 
<bind joystick="0" button="21" modifier="none" command="Cockpit::YawRight" />
 
<bind joystick="0" button="21" modifier="none" command="Cockpit::YawRight" />
 +
    <!-- #end -->
  
 
<!-- ThrottleSystem: MouseCursorControl (front)-->
 
<!-- ThrottleSystem: MouseCursorControl (front)-->
 +
    <!-- #joy_saitek_x45 -->
 
<bind joystick="0" button="22" modifier="none" command="Cockpit::InsideLeft" />
 
<bind joystick="0" button="22" modifier="none" command="Cockpit::InsideLeft" />
 
<bind joystick="0" button="23" modifier="none" command="Cockpit::Inside" />
 
<bind joystick="0" button="23" modifier="none" command="Cockpit::Inside" />
 
<bind joystick="0" button="24" modifier="none" command="Cockpit::InsideRight" />
 
<bind joystick="0" button="24" modifier="none" command="Cockpit::InsideRight" />
 
<bind joystick="0" button="25" modifier="none" command="Cockpit::InsideBack" />
 
<bind joystick="0" button="25" modifier="none" command="Cockpit::InsideBack" />
 +
    <!-- #end -->
 
<!-- buttons:END -->
 
<!-- buttons:END -->
  
 
<!-- axes:BEGIN -->
 
<!-- axes:BEGIN -->
 +
    <!-- #joy_saitek_x45 -->
 
<axis name="x" joystick="0" axis="0" inverse="false" />
 
<axis name="x" joystick="0" axis="0" inverse="false" />
 
<axis name="y" joystick="0" axis="1" inverse="false" />
 
<axis name="y" joystick="0" axis="1" inverse="false" />
 
<axis name="throttle" joystick="0" axis="4"/>
 
<axis name="throttle" joystick="0" axis="4"/>
 
<axis name="z" joystick="0" axis="3"/>
 
<axis name="z" joystick="0" axis="3"/>
 +
    <!-- #end -->
 
<!-- axes:END -->
 
<!-- axes:END -->
 
<!-- Joystick:USB Saitek X45 (4 axis, 25 buttons, 4 hatswitches):END -->
 
<!-- Joystick:USB Saitek X45 (4 axis, 25 buttons, 4 hatswitches):END -->
<!-- #end -->
 
 
</pre>
 
</pre>
  
Line 369: Line 558:
 
                 <axis name="z" joystick="0" axis="2" inverse="true"/>
 
                 <axis name="z" joystick="0" axis="2" inverse="true"/>
 
                 <!-- (Not Working) axis name="throttle" joystick="0" axis="3"/-->
 
                 <!-- (Not Working) axis name="throttle" joystick="0" axis="3"/-->
 +
<!-- #end -->
 
<!-- The digital pad has axis 4 and 5 and values of -1,0,1 -->
 
<!-- The digital pad has axis 4 and 5 and values of -1,0,1 -->
<!-- Need to work out what to use it for and how to use it -->
+
<!-- They Can be mapped to button imputs as so: -->
 +
<!-- #joy_log_dual_gp -->
 +
                <axis name="hatswitch" nr="0" margin="0.26" joystick="0" axis="4">
 +
                    <hatswitch value="-0.75"/>
 +
                    <hatswitch value="0.75"/>
 +
                </axis>
 +
                <axis name="hatswitch" nr="1" margin="0.26" joystick="0" axis="5">
 +
                    <hatswitch value="-0.75"/>
 +
                    <hatswitch value="0.75"/>
 +
                </axis>
 +
<!-- #end -->
 +
<!-- One way to use them is for attitude control thrusters for tight docking spaces. -->
 +
<!-- #joy_log_dual_gp -->
 +
        <bind hatswitch="0" button="0" command="ThrustLeft" />
 +
        <bind hatswitch="0" button="1" command="ThrustRight" />
 +
        <bind hatswitch="1" button="1" command="ThrustDown" />
 +
        <bind hatswitch="1" button="0" command="ThrustUp" />
 +
<!-- #end -->
 +
 
 
<!--The Buttons on this Joypad are clearly marked with numbers -->
 
<!--The Buttons on this Joypad are clearly marked with numbers -->
 
<!--Unfortunately they start with 1 and system starts with 0 -->
 
<!--Unfortunately they start with 1 and system starts with 0 -->
 +
<!-- #joy_log_dual_gp -->
 
         <bind joystick="0" button="0" modifier="none" command="ABKey" />
 
         <bind joystick="0" button="0" modifier="none" command="ABKey" />
 
         <bind joystick="0" button="1" modifier="none" command="DecelKey" />
 
         <bind joystick="0" button="1" modifier="none" command="DecelKey" />
Line 385: Line 594:
 
<!-- #end -->
 
<!-- #end -->
 
</pre>
 
</pre>
 +
 +
=== Playstation 2 controller (using a USB adaptor commonly available)  ===
 +
 +
==== Add the joystick-name to the dropdown menu ====
 +
add <code>joy_ps2</code>
 +
to the line
 +
<pre>
 +
#cat Joystick no_joy joy_normal joy_throttle joy_axis joy_throttle_and_axis joy_t_a_rev
 +
</pre>
 +
like this
 +
<pre>
 +
#cat Joystick no_joy joy_normal joy_throttle joy_axis joy_throttle_and_axis joy_t_a_rev joy_ps2
 +
</pre>
 +
 +
==== Add the description text ====
 +
<pre>
 +
#desc joy_ps2 Playstation 2 Joypad
 +
</pre>
 +
 +
==== Make the joystick the current one ====
 +
edit the <code>#set Joystick xxxx</code> line to
 +
<pre>
 +
#set Joystick joy_ps2
 +
</pre>
 +
 +
==== Binding code ====
 +
Place the code below above the <code></bindings></code> line in the <code>vegastrike.config</code> file.
 +
<pre>
 +
<!-- #joy_ps2 -->
 +
                <axis name="x" joystick="0" axis="0" inverse="false" />
 +
                <axis name="y" joystick="0" axis="1" inverse="false" />
 +
                <axis name="z" joystick="0" axis="2" inverse="true" />
 +
 +
                <axis name="hatswitch" nr="0" margin="0.26" joystick="0" axis="4">
 +
                    <hatswitch value="-0.75"/>
 +
                    <hatswitch value="0.75"/>
 +
                </axis>
 +
                <axis name="hatswitch" nr="1" margin="0.26" joystick="0" axis="5">
 +
                    <hatswitch value="-0.75"/>
 +
                    <hatswitch value="0.75"/>
 +
                </axis>
 +
 +
                <bind hatswitch="0" button="0" command="ReverseTargetKey" />
 +
                <bind hatswitch="0" button="1" command="TargetKey" />
 +
                <bind hatswitch="1" button="1" command="DecelKey" />
 +
                <bind hatswitch="1" button="0" command="AccelKey" />
 +
 +
<bind joystick="0" button="0" modifier="none" command="JumpKey" />
 +
<bind joystick="0" button="1" modifier="none" command="ToggleWarpDrive" />
 +
<bind joystick="0" button="2" modifier="none" command="ABKey" />
 +
<bind joystick="0" button="3" modifier="none" command="SwitchCombatMode" />
 +
<bind joystick="0" button="4" modifier="none" command="MissileKey" />
 +
<bind joystick="0" button="5" player="0" modifier="none" command="FireKey" />
 +
<bind joystick="0" button="6" modifier="none" command="MisSelKey" />
 +
<bind joystick="0" button="7" modifier="none" command="WeapSelKey" />
 +
<bind joystick="0" button="8" modifier="none" command="PauseKey" />
 +
<bind joystick="0" button="9" modifier="none" command="MissionTargetKey" />
 +
<bind joystick="0" button="10" modifier="none" command="Cockpit::SwitchLVDU" />
 +
<bind joystick="0" button="11" modifier="none" command="Cockpit::SwitchRVDU" />
 +
<!-- #end -->
 +
</pre>
 +
 +
This maps the -
 +
 +
Left analogue stick to the attitude controls (Nose - up, down, left, right)
 +
 +
Right analogue stick to roll left and right (I didn't find a useful function for the analogue up / down on this stick so left it out)
 +
 +
 +
R1 shoulder button = Cycle weapon select
 +
 +
R2 shoulder button = Fire selected weapons
 +
 +
 +
L1 shoulder button = Missile select
 +
 +
L2 shoulder button = Fire selected missile
 +
 +
 +
Triangle          = Jump drive (if equipped)
 +
 +
Square            = Switch combat mode (between combat speed and unlimited speed)
 +
 +
X                  = Afterburner
 +
 +
O                  = Toggle SPEC drive / Autopilot
 +
 +
 +
Dpad (if the analogue light on your pad is off (digital mode) has the same function as the left analogue stick, otherwise -)
 +
 +
Up                = Accelerate
 +
 +
Down              = Decelerate
 +
 +
L & R              = Cycle all in system targets
 +
 +
 +
Select            = Cycle mission target
 +
 +
Start              = Pause
 +
 +
 +
Clicking down on the joysticks
 +
 +
L3 (left joystick) = Cycle left HUD display
 +
 +
R3 (right joystick)= Cycle right HUD display
 +
 +
=== Xbox 360 controller (wireless and wired versions)  ===
 +
 +
==== Add the joystick-name to the dropdown menu ====
 +
add <code>joy_xbox_360</code>
 +
to the line
 +
<pre>
 +
#cat Joystick no_joy joy_normal joy_throttle joy_axis joy_throttle_and_axis joy_t_a_rev
 +
</pre>
 +
like this
 +
<pre>
 +
#cat Joystick no_joy joy_normal joy_throttle joy_axis joy_throttle_and_axis joy_t_a_rev joy_xbox_360
 +
</pre>
 +
 +
==== Add the description text ====
 +
<pre>
 +
#desc joy_xbox_360 Joypad
 +
</pre>
 +
 +
==== Make the joystick the current one ====
 +
edit the <code>#set Joystick xxxx</code> line to
 +
<pre>
 +
#set Joystick joy_xbox_360
 +
</pre>
 +
 +
==== Binding code ====
 +
Place the code below above the <code></bindings></code> line in the <code>vegastrike.config</code> file.
 +
<pre>
 +
<!-- #joy_xbox_360 -->
 +
 +
    <axis name="x" joystick="0" axis="0" inverse="false" />
 +
    <axis name="y" joystick="0" axis="1" inverse="true" />
 +
 +
    #right hand trigger fires primary weapon
 +
    <axis name="hatswitch" nr="0" margin="0.26" joystick="0" axis="5">
 +
    <hatswitch value="0.75"/>
 +
    </axis>
 +
 +
    <bind hatswitch="0" button="0" command="FireKey" />
 +
 +
<!-- #left hand trigger fires secondary weapon -->
 +
    <axis name="hatswitch" nr="1" margin="0.26" joystick="0" axis="2">
 +
    <hatswitch value="0.75"/>
 +
    </axis>
 +
 +
    <bind hatswitch="1" button="0" command="MissileKey" />
 +
 +
<!-- #right hand stick left / right rolls ship -->
 +
    <axis name="hatswitch" nr="2" margin="0.26" joystick="0" axis="3">
 +
    <hatswitch value="0.75"/>
 +
    <hatswitch value="-0.75"/>
 +
    </axis>
 +
 +
    <bind hatswitch="2" button="0" command="RollRightKey" />
 +
    <bind hatswitch="2" button="1" command="RollLeftKey" />
 +
 +
<!-- #dpad to control velocity -->
 +
    <bind joystick="0" digital-hatswitch="0" direction="up" command="AccelKey" />
 +
    <bind joystick="0" digital-hatswitch="0" direction="down" command="DecelKey" />
 +
    <bind joystick="0" digital-hatswitch="0" direction="left" command="StopKey" />
 +
    <bind joystick="0" digital-hatswitch="0" direction="right" command="StartKey" />
 +
 +
<!-- #remaining buttons -->
 +
    <bind joystick="0" button="0" modifier="none" command="ASAP" />
 +
    <bind joystick="0" button="1" modifier="none" command="JumpKey" />
 +
    <bind joystick="0" button="2" modifier="none" command="ABKey" />
 +
    <bind joystick="0" button="3" modifier="none" command="NearestHostileTargetKey" />
 +
    <bind joystick="0" button="4" modifier="none" command="MisSelKey" />
 +
    <bind joystick="0" button="5" modifier="none" command="WeapSelKey" />
 +
    <bind joystick="0" button="6" modifier="none" command="MissionTargetKey" />
 +
    <bind joystick="0" button="7" modifier="none" command="PauseKey" />
 +
    <bind joystick="0" button="9" modifier="none" command="Cockpit::SwitchLVDU" />
 +
    <bind joystick="0" button="10" modifier="none" command="Cockpit::SwitchRVDU" />
 +
 +
<!-- #end -->
 +
</pre>
 +
 +
The gamepad is mapped as follows:
 +
 +
A                  = Autopilot and Spec Drive
 +
 +
B                  = Jump Drive
 +
 +
X                  = Overdrive
 +
 +
Y                  = Nearest Hostile Target
 +
 +
LB                = Missile Select
 +
 +
RB                = Weapon Select
 +
 +
Back              = Mission Target
 +
 +
Pause              = Pause
 +
 +
Left Stick Button  = Switch Left VDU
 +
 +
Right Stick Button = Switch Right VDU
 +
 +
Left Stick    = Turn left / Right / Up / Down
 +
 +
Right Stick  = Roll Left / Right
 +
 +
Left Trigger  = Launch Missile
 +
 +
Right Trigger = Fire Weapon
 +
 +
Dpad Left  = Stop
 +
 +
Dpad Right = Full Throttle
 +
 +
Dpad Up    = Throttle Up
 +
 +
Dpad Down  = Throttle Down
  
 
== Joystick probing ==
 
== Joystick probing ==
Line 397: Line 827:
  
 
Normally, "jstest" will show all information on a single line and keep updating that line in-place, without scrolling downwards.  If it outputs multiple lines instead of updating the same line, you have a lot of axes and buttons (or a very narrow terminal window).  Some USB joysticks may even output a couple of screens worth of lines without you even touching the joystick.  Ignore everything until it stops scrolling &mdash; it's just the joystick "booting up".  After that, you can grab the joystick and test as normal.
 
Normally, "jstest" will show all information on a single line and keep updating that line in-place, without scrolling downwards.  If it outputs multiple lines instead of updating the same line, you have a lot of axes and buttons (or a very narrow terminal window).  Some USB joysticks may even output a couple of screens worth of lines without you even touching the joystick.  Ignore everything until it stops scrolling &mdash; it's just the joystick "booting up".  After that, you can grab the joystick and test as normal.
 +
 +
'''NOTE: If your joystick is at /dev/input/js0, you may need to create a symbolic link as follows:
 +
'''ln -s /dev/input/js0 /dev/js0'''
  
 
==See also==
 
==See also==
* Current [http://cvs.sourceforge.net/viewcvs.py/*checkout*/vegastrike/data4.x/vegastrike.config?rev=HEAD vegastrike.config] in the CVS.
+
* Current [http://vegastrike.svn.sourceforge.net/svnroot/vegastrike/trunk/data/vegastrike.config vegastrike.config] in SVN.
 +
 
  
 
----
 
----

Latest revision as of 09:18, 26 July 2016

View this site in other languages:   DeutschEnglishFrançaisEspañolPolskiItalianoNederlandsРуccкий简体中文


arrow_left.png Config:Advanced:Bindings:Mouse arrow_up.png Config:Advanced:Bindings Config:Advanced:Variables arrow_right.png

Joystick Configuration

This page provides working examples of different joystick configurations, showing how each button has been bound to operate a single Vega Strike function.

If a Joystick Configuration matches your joystick, you can edit copy the configuration here into your vegastrike config file.

JOYSTICK: bind

Sample

<bind joystick="0" player="0" button="0" modifier="none" command="FireKey" />

Description

  • joystick - Number of the joystick.
  • player - for which player is the command specified? (this is useful when you have more than one joystick that you wish to configure for the same user)
  • button - Number of the button on the joystick.
  • modifier - FIXME ? no clue ?
  • command - Specify the command to start when the button is pressed here. See Keyboard layout for description and a list of commands.

JOYSTICK: axis

Sample

<axis name="x" joystick="0" axis="0" inverse="false" />

Description

  • name - Name of the axis (in the game) to bind (x,y,z,throttle)
  • joystick - Number of the joystick.
  • axis - Number of axis of the joystick.
  • inverse - Set this to true if you want to inverse the axis direction and to false if not.

ANALOG COOLIHAT/HATSWITCH

forum link 1

Sample

<axis name="hatswitch" nr="0" margin="0.15" joystick="1" axis="2">
  <hatswitch value="-1.0"/>
  <hatswitch value="-0.6"/>
  <hatswitch value="-0.19"/>
  <hatswitch value="0.1"/>
</axis>

<bind hatswitch="0" button="0" modifier="none" command="ABKey" />
<bind hatswitch="0" button="1" modifier="none" command="AccelKey" />
<bind hatswitch="0" button="2" modifier="none" command="DecelKey" />
<bind hatswitch="0" button="3" modifier="none" command="StopKey" />

Once defined, analog hatswitches have their own number, and their "buttons" (positions) are defined independently of joysticks. When creating your <bind> tags, make sure you do not specify a joystick number (e.g. joystick="0"); this will bind buttons on the joystick rather than positions on the hatswitch.

DIGITAL COOLIHAT/HATSWITCH

forum link

Sample

<bind joystick="0" digital-hatswitch="0" direction="up" command="ABKey"/>

Description

  • joystick - Number of the joystick.
  • digital-hatswitch - Number of the digital hatswitch.
  • direction - Direction (-button) of digital hatswitch.
    • Possible values: "center", "up", "right", "left", "down", "rightup", "rightdown", "leftup", "leftdown"
  • command - Specify the command to start when the button is pressed here. See Keyboard layout for description and a list of commands.

Note: Digital hatswitches will "chord". If you supply commands for "left", "up", and "leftup", moving the hatswitch to the upper left will activate all three commands.

Note (2): Digital hatswitch support is disabled by default in the CVS tree. To enable it, edit your vegastrike.config and set "debug_digital_hatswitch" to "true". Be warned that this will send lots of debugging text to the console. Also, you cannot currently bind commands to "center". Both bugs have been submitted with a patch and may be resolved soon.


DIGITAL AXES/D-PAD AS HATSWITCH

This can allow one to use a (usually digital) axis such as a D-Pad as button commands, such as camera keys, etc.

Sample

<axis name="hatswitch" nr="0" margin="0.26" joystick="0" axis="2">
  <hatswitch value="-0.75"/>
  <hatswitch value="0.75"/>
</axis>
<axis name="hatswitch" nr="1" margin="0.26" joystick="0" axis="3">
  <hatswitch value="-0.75"/>
  <hatswitch value="0.75"/>
</axis>

<bind hatswitch="0" button="0" command="Cockpit::YawLeft" />
<bind hatswitch="0" button="1" command="Cockpit::YawRight" />
<bind hatswitch="1" button="0" command="Cockpit::PitchDown" />
<bind hatswitch="1" button="1" command="Cockpit::PitchUp" />

Description

In <axis> tags:

  • axis - Number of the joystick axes for up/down and left/right.
  • margin - basically, you want this to include 1.0 and -1.0, but not 0.0 when adding hatswitch-value +/- margin
  • joystick - 0=down/left, 1=up/right

In <bind> tags:

  • hatswitch and nr - Number of the two defined "hatswitches".
  • button - 0=down/left, 1=up/right
  • command - Specify the command to start when the button is pressed here. See Keyboard layout for description and a list of commands.

Joystick Examples

Please insert your working configs here.

Microsoft SideWinder Force Feedback Pro

(may work for other sidewinder-joysticks as well)

Add the joystick-name to the dropdown menu

add joy_ffp to the line

#cat Joystick no_joy joy_normal joy_throttle joy_axis joy_throttle_and_axis joy_t_a_rev

like this

#cat Joystick no_joy joy_normal joy_throttle joy_axis joy_throttle_and_axis joy_t_a_rev joy_ffp

Add the description text

#desc joy_ffp Microsoft SideWinder Force Feedback Pro

Make the joystick the current one

edit the #set Joystick xxxx line to

#set Joystick joy_ffp

Binding code

Place the code below above the </bindings> line in the vegastrike.config file. If you modify it, be sure not to include comments between vssetup makers (#joy_ffp and #end), as that will break it.

FIXME Attention: This bindings may not work under linux ... at least it doesn't for me since i switched. Help is always welcome.

<!-- Joystick:Microsoft SideWinder Force Feedback Pro:BEGIN-->
<!-- buttons:BEGIN -->
<!-- #joy_ffp -->
 <bind joystick="0" player="0" button="0" modifier="none" command="FireKey" />  <!-- stick:fire key -->
 <bind joystick="0" button="1" modifier="none" command="MissileKey" />          <!-- stick:left key -->
 <bind joystick="0" button="2" modifier="none" command="TargetKey" />           <!-- stick:top right key -->
 <bind joystick="0" button="3" modifier="none" command="PickTargetKey" />       <!-- stick:bottom right key -->
 <bind joystick="0" button="4" modifier="none" command="ABKey" />               <!-- socket:"A" key -->
 <bind joystick="0" button="5" modifier="none" command="MisSelKey" />           <!-- socket:"B" key -->
 <bind joystick="0" button="6" modifier="none" command="WeapSelKey" />          <!-- socket:"C" key -->
 <bind joystick="0" button="7" modifier="none" command="AccelKey" />            <!-- socket:"D" key -->
 <bind joystick="0" button="8" modifier="none" command="SheltonKey" />          <!-- not used? -->
 <bind joystick="0" button="9" modifier="none" command="DecelKey" />            <!-- socket:shift key -->
<!-- #end -->
<!-- buttons:END -->

<!-- axes:BEGIN -->
<!-- #joy_ffp -->
 <axis name="x"        joystick="0" axis="0" inverse="false" /> <!-- stick:left/right -->
 <axis name="y"        joystick="0" axis="1" inverse="false" /> <!-- stick:up/down -->
 <axis name="z"        joystick="0" axis="3" inverse="true" />  <!-- stick:roll left/right -->
 <!-- <axis name="throttle" joystick="0" axis="2" inverse="false" /> not working in 0.4.x -->   <!-- socket:throttle -->
 <!--vvv throttle axis vvvv-->
 <axis name="hatswitch" nr="0" margin="0.25" joystick="0" axis="2" inverse="false"> <!-- socket:throttle -->
   <hatswitch value="-1.0"/>
   <hatswitch value="-0.5"/>
   <hatswitch value="0.5"/>
   <hatswitch value="1.0"/>
 </axis>
<!-- #end -->
<!-- axes:END -->

<!-- throttle-bindings:BEGIN -->
<!-- #joy_ffp -->
 <bind hatswitch="0" button="0" modifier="none" command="ABKey" />
 <bind hatswitch="0" button="1" modifier="none" command="AccelKey" />
 <bind hatswitch="0" button="2" modifier="none" command="DecelKey" />
 <bind hatswitch="0" button="3" modifier="none" command="StopKey" />
<!-- #end -->
<!-- throttle-bindings:END -->

<!-- hatswitch:BEGIN -->
<!-- #joy_ffp -->
 <bind joystick="0" digital-hatswitch="0" direction="up"     command="Cockpit::Inside"/>
 <bind joystick="0" digital-hatswitch="0" direction="left"   command="Cockpit::InsideLeft"/>
 <bind joystick="0" digital-hatswitch="0" direction="center" command="Cockpit::Inside"/>
 <bind joystick="0" digital-hatswitch="0" direction="right"  command="Cockpit::InsideRight"/>
 <bind joystick="0" digital-hatswitch="0" direction="down"   command="Cockpit::InsideBack"/>
<!-- #end -->
<!-- hatswitch:END -->
<!-- Joystick:Microsoft SideWinder Force Feedback Pro:END-->

Microsoft SideWinder Force Feedback 2 (USB)

Linux 2.4

(tested kernels: 2.4.27)

This model shows up in Linux as having 11 axes and 20 buttons, but only nine buttons and six axes are used, two of which are for the pseudo-analog hatstick (which is really effectively digital).

The hatswitch configuration is special here. The configuration below uses a "return to center" system, where releasing the hatswitch returns to standard cockpit view. Hence, the obvious way would be to define a centered axis (0) as returning to Cockpit::Inside. But when this was defined for both axes, it didn't work; pressing left or right would only flicker in that direction, instantly returning to center even if the hatswitch was held. This is because horizontal movement of the hatswitch (away from center) somehow also triggers vertical movement events, even if the vertical axis has not changed. The vertical centering was cancelling out the left-right movement.

By defining the return-to-center behaviour only on the horizontal movement, everything works perfectly: Horizontal movement is unimpeded by vertical movement events, and returning the vertical axis to center somehow also triggers a centered horizontal event, returning the view to the inside. The cause of this inconsistency is unknown, but the effect is exactly as desired.

Once the myriad axes are out of the way, the buttons are exceedingly simple; the first eight buttons (0 through 7) map directly to the stick buttons. Button #11 is a special virtual button that is "pressed" when the hand leaves the stick (via an optical sensor). Docking at a space station is the most logical use for this "button", since that's when the user will want to let go of the joystick anyway; aside from saving a keypress, it's also good for amazing any onlookers with the user's "magic" joystick.

 <!-- Trigger button (1) and labelled buttons 2 through 8, in order. -->
 <!-- #joy_ff2 -->
  <bind joystick="0" player="0" button="0" modifier="none" command="FireKey" />
  <bind joystick="0" button="1" modifier="none" command="MissileKey" />
  <bind joystick="0" button="2" modifier="none" command="TargetKey" />
  <bind joystick="0" button="3" modifier="none" command="PickTargetKey" />
  <bind joystick="0" button="4" modifier="none" command="MisSelKey" />
  <bind joystick="0" button="5" modifier="none" command="WeapSelKey" />
  <bind joystick="0" button="6" modifier="none" command="SheltonKey" />
  <bind joystick="0" button="7" modifier="none" command="ABKey" />
 <!-- #end -->

 <!-- The special button triggered when the hand leaves the stick. -->
 <!-- #joy_ff2 -->
  <bind joystick="0" button="11" modifier="none" command="DockKey" />
 <!-- #end -->

 <!-- The axes aren't sequential; many are unused. -->
 <!-- #joy_ff2 -->
  <axis joystick="0" axis="0" name="x" inverse="false" />
  <axis joystick="0" axis="1" name="y" inverse="false" />
  <axis joystick="0" axis="4" name="z" inverse="true" />
  <axis joystick="0" axis="5" name="throttle" inverse="false" />
 <!-- #end -->

 <!-- Hatswitch left-right movement. -->
 <!-- #joy_ff2 -->
  <axis joystick="0" axis="6" name="hatswitch" nr="0" margin="0.5" inverse="false">
    <hatswitch value="-1.0"/>
    <hatswitch value="1.0"/>
    <hatswitch value="0"/>
  </axis>
  <bind hatswitch="0" button="0" modifier="none" command="Cockpit::InsideLeft" />
  <bind hatswitch="0" button="1" modifier="none" command="Cockpit::InsideRight"/>
  <bind hatswitch="0" button="2" modifier="none" command="Cockpit::Inside" />
 <!-- #end -->

 <!-- Hatswitch up-down movement. -->
 <!-- #joy_ff2 -->
  <axis joystick="0" axis="7" name="hatswitch" nr="1" margin="0.5" inverse="false">
    <hatswitch value="-1.0"/>
    <hatswitch value="1.0"/>
  </axis>
  <bind hatswitch="1" button="0" modifier="none" command="Cockpit::Behind" />
  <bind hatswitch="1" button="1" modifier="none" command="Cockpit::InsideBack" />
 <!-- #end -->

Linux 2.6

(tested kernels: 2.6.10, 2.6.11, 2.6.12)

Things become much simpler in Linux 2.6. The hatswitch is actually recognised as a digital hatswitch, and the virtual "hand off joystick" button becomes button 8, right after the eight physical buttons. On the other hand, the throttle and twist axes numbers actually move to higher numbers. Still, things get simpler overall.

The stick's reported properties vary greatly between kernel versions:

  • 2.6.10: 18 axes, 15 buttons, 1 hat
  • 2.6.12: 12 axes, 9 buttons, 1 hat

Apparently, the device code is still being worked on, but it seems the detection is getting closer and closer to the truth.

Below is the exact same configuration as above, but adapted for the 2.6 series of kernels:

<!-- #joy_ff2 -->
 <bind joystick="0" player="0" button="0" modifier="none" command="FireKey" />
 <bind joystick="0" button="1" modifier="none" command="MissileKey" />
 <bind joystick="0" button="2" modifier="none" command="TargetKey" />
 <bind joystick="0" button="3" modifier="none" command="PickTargetKey" />
 <bind joystick="0" button="4" modifier="none" command="MisSelKey" />
 <bind joystick="0" button="5" modifier="none" command="WeapSelKey" />
 <bind joystick="0" button="6" modifier="none" command="SheltonKey" />
 <bind joystick="0" button="7" modifier="none" command="ABKey" />
 <bind joystick="0" button="8" modifier="none" command="DockKey" />

 <axis joystick="0" axis="0" name="x" inverse="false" />
 <axis joystick="0" axis="1" name="y" inverse="false" />
 <axis joystick="0" axis="5" name="z" inverse="true" />
 <axis joystick="0" axis="6" name="throttle" inverse="false" />

 <bind joystick="0" digital-hatswitch="0" direction="up" command="Cockpit::Behind"/>
 <bind joystick="0" digital-hatswitch="0" direction="down" command="Cockpit::InsideBack"/>
 <bind joystick="0" digital-hatswitch="0" direction="left" command="Cockpit::InsideLeft"/>
 <bind joystick="0" digital-hatswitch="0" direction="right" command="Cockpit::InsideRight"/>
 <bind joystick="0" digital-hatswitch="0" direction="center" command="Cockpit::Inside"/>
<!-- #end -->


Microsoft SideWinder Precision 2 (USB)

Tested under Windows XP Home. Digital coolihat/hatswitch left un-assigned.

Add the joystick-name to the dropdown menu

add joy_msswp2 like this

#cat Joystick no_joy joy_normal joy_throttle joy_axis joy_throttle_and_axis joy_t_a_rev joy_msswp2

Add the description text

#desc joy_msswp2 Microsoft SideWinder Precision 2

Make the joystick the current one

#set Joystick joy_msswp2

Binding code

Place the code below above the </bindings> line in the vegastrike.config file.

   <!-- Joystick:Microsoft SideWinder Precision 2:BEGIN-->
      <!-- buttons:BEGIN -->
        <!-- #joy_msswp2 -->
         <bind joystick="0" player="0" button="0" modifier="none" command="FireKey" />  
         <bind joystick="0" button="1" modifier="none" command="MissileKey" />          
         <bind joystick="0" button="2" modifier="none" command="PickTargetKey" />       
         <bind joystick="0" button="3" modifier="none" command="LockTargetKey" />       
         <bind joystick="0" button="4" modifier="none" command="TargetKey" />           
         <bind joystick="0" button="5" modifier="none" command="MisSelKey" />           
         <bind joystick="0" button="6" modifier="none" command="WeapSelKey" />          
         <bind joystick="0" button="7" modifier="none" command="SheltonKey" />         
        <!-- #end -->
      <!-- buttons:END -->
                        
      <!-- axes:BEGIN -->
        <!-- #joy_msswp2 -->
         <axis name="x"        joystick="0" axis="0" inverse="false" /> 
         <axis name="y"        joystick="0" axis="1" inverse="false" /> 
         <axis name="z"        joystick="0" axis="3" inverse="true" />  
         <axis name="throttle" joystick="0" axis="2"/> 
        <!-- #end -->
      <!-- axes:END -->

   <!-- Joystick:Microsoft SideWinder Precision 2:END-->

USB Saitek Cyborg 3D

4-axis/8-buttons/1-hatswitch stick + CH pedals on a gameport 

http://forums.vega-strike.org/viewtopic.php?p=12580#12580 forum link

<!-- Joystick:USB Saitek Cyborg 3D (4 axis 10 button 1 hatswitch):BEGIN -->
<!-- buttons:BEGIN -->
<!-- #joy_cyborg3d -->
  <bind joystick="1" player="0"  button="0" modifier="none" command="FireKey" />
  <bind joystick="1" button="1"  modifier="none" command="ABKey" />
  <bind joystick="1" button="2"  modifier="none" command="StopKey" />
  <bind joystick="1" button="3"  modifier="none" command="TargetKey" />
  <bind joystick="1" button="4"  modifier="none" command="PickTargetKey" />
  <bind joystick="1" button="5"  modifier="none" command="DecelKey" />
  <bind joystick="1" button="6"  modifier="none" command="SheltonKey" />
  <bind joystick="1" button="7"  modifier="none" command="AccelKey" />
  <bind joystick="1" button="8"  modifier="none" command="Cockpit::NavScreen" />
  <bind joystick="1" button="9"  modifier="none" command="MisSelKey" />
  <bind joystick="1" button="10" modifier="none" command="Cockpit::Inside" />
  <bind joystick="1" button="11" modifier="none" command="Cockpit::InsideLeft" />
  <bind joystick="1" button="12" modifier="none" command="Cockpit::InsideRight" />
  <bind joystick="1" button="13" modifier="none" command="Cockpit::InsideBack" />
<!-- #end -->
<!-- buttons:END -->

<!-- axes:BEGIN -->
<!-- #joy_cyborg3d -->
  <axis name="x" joystick="1" axis="0" inverse="false" />
  <axis name="y" joystick="1" axis="1" inverse="false" />
  <!-- <axis name="throttle" joystick="1" axis="2"/> -->
<!-- #end -->
<!-- axes:END -->
<!-- Joystick:USB Saitek Cyborg 3D (4 axis 10 button 1 hatswitch):END -->

<!-- gameport CH pedals:BEGIN -->
<!-- axes:BEGIN -->
<!-- #joy_cyborg3d -->
  <axis name="z" joystick="0" axis="3" inverse="true"/>
<!-- #end -->
<!-- axes:END -->
<!-- gameport CH pedals:END -->

USB Saitek Cyborg 3DII

This config has only been tested on Linux, but it is likely to work elsewhere.

From: http://forums.vega-strike.org/viewtopic.php?t=8620 (GordonShomway)

I have an old Saitek Cyborg 3DII USB. When I configured the Joystick as "2 axis and throttle" or "3 axis (and throttle)", the throttle was on the z-axis and the twist on the leaver for the throttle.

In order to fix this I had to change the number of the axis' as follows:

throttle from 2 to 3.

Here is the configuration for "3 axis and throttle"

<axis name="x" joystick="0" axis="0" inverse="false" />
<axis name="y" joystick="0" axis="1" inverse="false" />
<axis name="z" joystick="0" axis="2" inverse="false" />
<axis name="throttle" joystick="0" axis="3" inverse="false" />

USB Saitek AV8R-01

4 axis/12 button/8-digital hatswitch/2 rotary control/dual throttle.

This is the configuration for pitch/roll on primary axes, yaw on "twist" control, and main throttle on left.

	<axis name="x" joystick="0" axis="3" inverse="false" />
	<axis name="y" joystick="0" axis="1" inverse="false" />
	<axis name="z" joystick="0" axis="0" inverse="true" />
	<axis name="throttle" joystick="0" axis="2" />

These are some good button controls

	<bind joystick="0" player="0" button="0" modifier="none" command="FireKey" />
	<bind joystick="0" button="1" modifier="none" command="MissileKey" />
	<bind joystick="0" button="2" modifier="none" command="NearestDangerousHostileKey" />
	<bind joystick="0" button="3" modifier="none" command="ABKey" />

	<bind joystick="0" button="4" modifier="none" command="ThrustUp" />
	<bind joystick="0" button="5" modifier="none" command="ThrustDown" />

	<bind joystick="0" button="6" modifier="none" command="MissionTargetKey" />
	<bind joystick="0" button="7" modifier="none" command="ThrustLeft" />

	<bind joystick="0" button="8" modifier="none" command="SigTargetKey" />
	<bind joystick="0" button="9" modifier="none" command="ThrustRight" />

	<bind joystick="0" button="10" modifier="none" command="Cockpit::SwitchLVDU" />
	<bind joystick="0" button="11" modifier="none" command="Cockpit::SwitchRVDU" />

	<bind joystick="0" button="12" modifier="none" command="StopKey" />
	<bind joystick="0" button="13" modifier="none" command="" />

The following is a "sticky" hat control

	<bind joystick="0" digital-hatswitch="0" direction="up" command="Cockpit::Inside"/>
	<bind joystick="0" digital-hatswitch="0" direction="left" command="Cockpit::InsideLeft"/>
	<bind joystick="0" digital-hatswitch="0" direction="right" command="Cockpit::InsideRight"/>
	<bind joystick="0" digital-hatswitch="0" direction="down" command="Cockpit::InsideBack"/>

Add this to make the hat control return to norma view after it is released

   	<bind joystick="0" digital-hatswitch="0" direction="center" command="Cockpit::NavScreen"/>

USB Saitek X45

4-axis/7-button/4-hatswitch/2 rotary control, 2 mode switch (M1,M2,M3 and AUX0-1) stick/flight control system.

3 of the 4 hatswitches could be called like buttons. So I configured them for Cockpit Display and Weapon Selection. Until now the 2 rotary controls are unused. The mode switches are configured for SPEC/cloak.

<!-- Joystick:USB Saitek X45 (4 axis, 7 buttons, 4 hatswitches):BEGIN -->
<!-- buttons:BEGIN -->
    <!-- #joy_saitek_x45 -->
	<bind joystick="0" player="0"  button="0" modifier="none" command="FireKey" />
	<bind joystick="0" button="3"  modifier="none" command="MissileKey" />
	<bind joystick="0" button="4"  modifier="none" command="ABKey" />
	<bind joystick="0" button="5"  modifier="none" command="Cockpit::SwitchRVDU" />
	<bind joystick="0" button="1"  modifier="none" command="UnitTargetKey" />
	<bind joystick="0" button="2"  modifier="none" command="SigTargetKey" />
	<bind joystick="0" button="7"  modifier="none" command="NearestTargetKey" />
    <!-- #end -->

<!-- button 6 is originally intended as Shift button -->
<!--	<bind joystick="0" button="6"  modifier="none" command="Cockpit::NavScreen" /> -->

    <!-- #joy_saitek_x45 -->
	<bind joystick="0" button="8"  modifier="none" command="CloakKey" />
	<bind joystick="0" button="9"  modifier="none" command="CloakKey" />
	<bind joystick="0" button="10" modifier="none" command="CloakKey" />

	<bind joystick="0" button="11" modifier="none" command="ToggleWarpDrive" />
	<bind joystick="0" button="12" modifier="none" command="ToggleWarpDrive" />
	<bind joystick="0" button="13" modifier="none" command="ToggleWarpDrive" />
    <!-- #end -->

<!-- Joystick: HatSwitch 2 (left) -->
    <!-- #joy_saitek_x45 -->
	<bind joystick="0" button="14" modifier="none" command="WeapSelKey" />
	<bind joystick="0" button="15" modifier="none" command="MisSelKey" />
	<bind joystick="0" button="16" modifier="none" command="ReverseWeapSelKey" />
	<bind joystick="0" button="17" modifier="none" command="ReverseMisSelKey" />
    <!-- #end -->

<!-- ThrottleSystem: HatSwitch 3 (back)-->
    <!-- #joy_saitek_x45 -->
	<bind joystick="0" button="18" modifier="none" command="Cockpit::PitchDown" />
	<bind joystick="0" button="19" modifier="none" command="Cockpit::YawLeft" />
	<bind joystick="0" button="20" modifier="none" command="Cockpit::PitchUp" />
	<bind joystick="0" button="21" modifier="none" command="Cockpit::YawRight" />
    <!-- #end -->

<!-- ThrottleSystem: MouseCursorControl (front)-->
    <!-- #joy_saitek_x45 -->
	<bind joystick="0" button="22" modifier="none" command="Cockpit::InsideLeft" />
	<bind joystick="0" button="23" modifier="none" command="Cockpit::Inside" />
	<bind joystick="0" button="24" modifier="none" command="Cockpit::InsideRight" />
	<bind joystick="0" button="25" modifier="none" command="Cockpit::InsideBack" />
    <!-- #end -->
<!-- buttons:END -->

<!-- axes:BEGIN -->
    <!-- #joy_saitek_x45 -->
	<axis name="x" joystick="0" axis="0" inverse="false" />
	<axis name="y" joystick="0" axis="1" inverse="false" />
	<axis name="throttle" joystick="0" axis="4"/>
	<axis name="z" joystick="0" axis="3"/>
    <!-- #end -->
<!-- axes:END -->
<!-- Joystick:USB Saitek X45 (4 axis, 25 buttons, 4 hatswitches):END -->

Logitech Dual Analog Gamepad

Add the joystick-name to the dropdown menu

add joy_log_dual_gp to the line

#cat Joystick no_joy joy_normal joy_throttle joy_axis joy_throttle_and_axis joy_t_a_rev

like this

#cat Joystick no_joy joy_normal joy_throttle joy_axis joy_throttle_and_axis joy_t_a_rev joy_log_dual_gp

Add the description text

#desc joy_log_dual_gp Logitech Dual Analog Gamepad

Make the joystick the current one

edit the #set Joystick xxxx line to

#set Joystick joy_log_dual_gp

Binding code

Place the code below above the </bindings> line in the vegastrike.config file.

<!-- #joy_log_dual_gp -->
                <axis name="x" joystick="0" axis="0" inverse="false" />
                <axis name="y" joystick="0" axis="1" inverse="true" />
                <axis name="z" joystick="0" axis="2" inverse="true"/>
                <!-- (Not Working) axis name="throttle" joystick="0" axis="3"/-->
<!-- #end -->
<!-- The digital pad has axis 4 and 5 and values of -1,0,1 -->
<!-- They Can be mapped to button imputs as so: -->
<!-- #joy_log_dual_gp -->
                <axis name="hatswitch" nr="0" margin="0.26" joystick="0" axis="4">
                    <hatswitch value="-0.75"/>
                    <hatswitch value="0.75"/>
                </axis>
                <axis name="hatswitch" nr="1" margin="0.26" joystick="0" axis="5">
                    <hatswitch value="-0.75"/>
                    <hatswitch value="0.75"/>
                </axis>
<!-- #end -->
<!-- One way to use them is for attitude control thrusters for tight docking spaces. -->
<!-- #joy_log_dual_gp -->
        <bind hatswitch="0" button="0" command="ThrustLeft" />
        <bind hatswitch="0" button="1" command="ThrustRight" />
        <bind hatswitch="1" button="1" command="ThrustDown" />
        <bind hatswitch="1" button="0" command="ThrustUp" />
<!-- #end -->

<!--The Buttons on this Joypad are clearly marked with numbers -->
<!--Unfortunately they start with 1 and system starts with 0 -->
<!-- #joy_log_dual_gp -->
        <bind joystick="0" button="0" modifier="none" command="ABKey" />
        <bind joystick="0" button="1" modifier="none" command="DecelKey" />
        <bind joystick="0" button="2" modifier="none" command="DockKey" />
        <bind joystick="0" button="3" modifier="none" command="AccelKey" />
        <bind joystick="0" button="4" modifier="none" command="TargetKey" />
        <bind joystick="0" button="5" player="0" modifier="none" command="FireKey" />
        <bind joystick="0" button="6" modifier="none" command="PickTargetKey" />
        <bind joystick="0" button="7" modifier="none" command="MissileKey" />
        <bind joystick="0" button="8" modifier="none" command="WeapSelKey" />
        <bind joystick="0" button="9" modifier="none" command="AutoKey" />
<!-- #end -->

Playstation 2 controller (using a USB adaptor commonly available)

Add the joystick-name to the dropdown menu

add joy_ps2 to the line

#cat Joystick no_joy joy_normal joy_throttle joy_axis joy_throttle_and_axis joy_t_a_rev

like this

#cat Joystick no_joy joy_normal joy_throttle joy_axis joy_throttle_and_axis joy_t_a_rev joy_ps2

Add the description text

#desc joy_ps2 Playstation 2 Joypad

Make the joystick the current one

edit the #set Joystick xxxx line to

#set Joystick joy_ps2

Binding code

Place the code below above the </bindings> line in the vegastrike.config file.

<!-- #joy_ps2 -->
                <axis name="x" joystick="0" axis="0" inverse="false" />
                <axis name="y" joystick="0" axis="1" inverse="false" />
                <axis name="z" joystick="0" axis="2" inverse="true" />

                <axis name="hatswitch" nr="0" margin="0.26" joystick="0" axis="4">
                    <hatswitch value="-0.75"/>
                    <hatswitch value="0.75"/>
                </axis>
                <axis name="hatswitch" nr="1" margin="0.26" joystick="0" axis="5">
                    <hatswitch value="-0.75"/>
                    <hatswitch value="0.75"/>
                </axis>

                <bind hatswitch="0" button="0" command="ReverseTargetKey" />
                <bind hatswitch="0" button="1" command="TargetKey" />
                <bind hatswitch="1" button="1" command="DecelKey" />
                <bind hatswitch="1" button="0" command="AccelKey" />

		<bind joystick="0" button="0" modifier="none" command="JumpKey" />
		<bind joystick="0" button="1" modifier="none" command="ToggleWarpDrive" />
		<bind joystick="0" button="2" modifier="none" command="ABKey" />
		<bind joystick="0" button="3" modifier="none" command="SwitchCombatMode" />
		<bind joystick="0" button="4" modifier="none" command="MissileKey" />
		<bind joystick="0" button="5" player="0" modifier="none" command="FireKey" />
		<bind joystick="0" button="6" modifier="none" command="MisSelKey" />
		<bind joystick="0" button="7" modifier="none" command="WeapSelKey" />
		<bind joystick="0" button="8" modifier="none" command="PauseKey" />
		<bind joystick="0" button="9" modifier="none" command="MissionTargetKey" />
		<bind joystick="0" button="10" modifier="none" command="Cockpit::SwitchLVDU" />
		<bind joystick="0" button="11" modifier="none" command="Cockpit::SwitchRVDU" />
<!-- #end -->

This maps the -

Left analogue stick to the attitude controls (Nose - up, down, left, right)

Right analogue stick to roll left and right (I didn't find a useful function for the analogue up / down on this stick so left it out)


R1 shoulder button = Cycle weapon select

R2 shoulder button = Fire selected weapons


L1 shoulder button = Missile select

L2 shoulder button = Fire selected missile


Triangle = Jump drive (if equipped)

Square = Switch combat mode (between combat speed and unlimited speed)

X = Afterburner

O = Toggle SPEC drive / Autopilot


Dpad (if the analogue light on your pad is off (digital mode) has the same function as the left analogue stick, otherwise -)

Up = Accelerate

Down = Decelerate

L & R = Cycle all in system targets


Select = Cycle mission target

Start = Pause


Clicking down on the joysticks

L3 (left joystick) = Cycle left HUD display

R3 (right joystick)= Cycle right HUD display

Xbox 360 controller (wireless and wired versions)

Add the joystick-name to the dropdown menu

add joy_xbox_360 to the line

#cat Joystick no_joy joy_normal joy_throttle joy_axis joy_throttle_and_axis joy_t_a_rev

like this

#cat Joystick no_joy joy_normal joy_throttle joy_axis joy_throttle_and_axis joy_t_a_rev joy_xbox_360

Add the description text

#desc joy_xbox_360 Joypad

Make the joystick the current one

edit the #set Joystick xxxx line to

#set Joystick joy_xbox_360

Binding code

Place the code below above the </bindings> line in the vegastrike.config file.

<!-- #joy_xbox_360 -->

    <axis name="x" joystick="0" axis="0" inverse="false" />
    <axis name="y" joystick="0" axis="1" inverse="true" />

    #right hand trigger fires primary weapon
    <axis name="hatswitch" nr="0" margin="0.26" joystick="0" axis="5">
    <hatswitch value="0.75"/>
    </axis>

    <bind hatswitch="0" button="0" command="FireKey" />

<!-- #left hand trigger fires secondary weapon -->
    <axis name="hatswitch" nr="1" margin="0.26" joystick="0" axis="2">
    <hatswitch value="0.75"/>
    </axis>

    <bind hatswitch="1" button="0" command="MissileKey" />

<!-- #right hand stick left / right rolls ship -->
    <axis name="hatswitch" nr="2" margin="0.26" joystick="0" axis="3">
    <hatswitch value="0.75"/>
    <hatswitch value="-0.75"/>
    </axis>

    <bind hatswitch="2" button="0" command="RollRightKey" />
    <bind hatswitch="2" button="1" command="RollLeftKey" />

<!-- #dpad to control velocity -->
    <bind joystick="0" digital-hatswitch="0" direction="up" command="AccelKey" />
    <bind joystick="0" digital-hatswitch="0" direction="down" command="DecelKey" />
    <bind joystick="0" digital-hatswitch="0" direction="left" command="StopKey" />
    <bind joystick="0" digital-hatswitch="0" direction="right" command="StartKey" />

<!-- #remaining buttons -->
    <bind joystick="0" button="0" modifier="none" command="ASAP" />
    <bind joystick="0" button="1" modifier="none" command="JumpKey" />
    <bind joystick="0" button="2" modifier="none" command="ABKey" />
    <bind joystick="0" button="3" modifier="none" command="NearestHostileTargetKey" />
    <bind joystick="0" button="4" modifier="none" command="MisSelKey" />
    <bind joystick="0" button="5" modifier="none" command="WeapSelKey" />
    <bind joystick="0" button="6" modifier="none" command="MissionTargetKey" />
    <bind joystick="0" button="7" modifier="none" command="PauseKey" />
    <bind joystick="0" button="9" modifier="none" command="Cockpit::SwitchLVDU" />
    <bind joystick="0" button="10" modifier="none" command="Cockpit::SwitchRVDU" />

<!-- #end -->

The gamepad is mapped as follows:

A = Autopilot and Spec Drive

B = Jump Drive

X = Overdrive

Y = Nearest Hostile Target

LB = Missile Select

RB = Weapon Select

Back = Mission Target

Pause = Pause

Left Stick Button = Switch Left VDU

Right Stick Button = Switch Right VDU

Left Stick = Turn left / Right / Up / Down

Right Stick = Roll Left / Right

Left Trigger = Launch Missile

Right Trigger = Fire Weapon

Dpad Left = Stop

Dpad Right = Full Throttle

Dpad Up = Throttle Up

Dpad Down = Throttle Down

Joystick probing

If you can't seem to properly bind your various joystick axes, buttons, and hatswitches, your joystick may be reporting its various functions in unexpected ways. Probing your joystick allows you to test each part of the joystick and see what events it sends to your computer.

Linux

To probe a joystick in Linux, you need the "jstest" utility. (In Debian, this is part of the "joystick" package.) Locate your joystick device (typically /dev/js0) and run "jstest" on it while not touching the joystick. You'll see a series of axis positions and button states.

Once "jstest" is running, grab the joystick and fiddle with whatever function you were unable to bind. Watch the readout and determine what axis or button your actions are triggering. With this knowledge, you should be able to use one of the recipes above (or an existing entry in the vegastrike.config file) to fully map your joystick.

Normally, "jstest" will show all information on a single line and keep updating that line in-place, without scrolling downwards. If it outputs multiple lines instead of updating the same line, you have a lot of axes and buttons (or a very narrow terminal window). Some USB joysticks may even output a couple of screens worth of lines without you even touching the joystick. Ignore everything until it stops scrolling — it's just the joystick "booting up". After that, you can grab the joystick and test as normal.

NOTE: If your joystick is at /dev/input/js0, you may need to create a symbolic link as follows: ln -s /dev/input/js0 /dev/js0

See also



arrow_left.png Config:Advanced:Bindings:Mouse arrow_up.png Config:Advanced:Bindings Config:Advanced:Variables arrow_right.png