Difference between revisions of "Fr:Manuel:Config:Avancé:Liaisons:Joystick"
Greendreamer (talk | contribs) (→Joystick Examples) |
m ([vega-bot] [replace] 4 instances of 'http://vegastrike.sourceforge.net/forums' for 'http://forums.vega-strike.org') |
||
Line 41: | Line 41: | ||
===Coolie Hat/ou Hatswitch analogiques=== | ===Coolie Hat/ou Hatswitch analogiques=== | ||
− | [http:// | + | [http://forums.vega-strike.org/viewtopic.php?p=17017#17017 forum link 1] |
Les boutons de type coolie hat (en forme de chapeau chinois, habituellement sur le sommet du joystick, que l'on peut pousser sur 4 ou 8 directions) sont maintenant souvent présents sur les joysticks. | Les boutons de type coolie hat (en forme de chapeau chinois, habituellement sur le sommet du joystick, que l'on peut pousser sur 4 ou 8 directions) sont maintenant souvent présents sur les joysticks. | ||
Line 62: | Line 62: | ||
===Coolie Hat/ou Hatswitch digitaux=== | ===Coolie Hat/ou Hatswitch digitaux=== | ||
− | [http:// | + | [http://forums.vega-strike.org/viewtopic.php?p=17017#17017 forum link] |
====Échantillon==== | ====Échantillon==== | ||
Line 351: | Line 351: | ||
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:// | + | http://forums.vega-strike.org/viewtopic.php?p=12580#12580 |
forum link | forum link | ||
Line 396: | Line 396: | ||
This config has only been tested on Linux, but it is likely to work elsewhere. | This config has only been tested on Linux, but it is likely to work elsewhere. | ||
− | From: http:// | + | 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. | 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. |
Revision as of 22:28, 8 January 2013
Ce site dans d'autres langues: Deutsch – English – Français – Español – Polski – Italiano – Nederlands – Руccкий – 简体中文
Contrôles souris | Configuration avancée : contrôles et raccourcis | Config:Advanced:Colors |
Contents
- 1 Configuration du Joystick
- 2 Exemples de joystick
- 2.1 Microsoft SideWinder Force Feedback Pro
- 2.2 Microsoft SideWinder Force Feedback 2 (USB)
- 2.3 Microsoft SideWinder Precision 2 (USB)
- 2.4 USB Saitek Cyborg 3D
- 2.5 USB Saitek Cyborg 3DII
- 2.6 USB Saitek AV8R-01
- 2.7 USB Saitek X45
- 2.8 Logitech Dual Analog Gamepad
- 2.9 Playstation 2 controller (using a USB adaptor commonly available)
- 3 Joystick probing
- 4 See also
Configuration du Joystick
Cette page fournit des exemples testés de différentes configurations de joysticks, montrant comment chaque bouton a été lié à une fonction unique de Vega Strike.
Si une configuration de joystick correspond à vôtre joystick, vous pouvez copier la configuration ci-présente dans le fichier de configuration de votre Vega Strike.
JOYSTICK: liaisons
Échantillon
<bind joystick="0" player="0" button="0" modifier="none" command="FireKey" />
Description
-
joystick
- Numéro du joystick. -
player
- Les commandes sont spécifiées pour chaque joueur? (c'est utile lorsque vous avez plusieurs joysticks que vous voulez configurer pour le même utilisateur) -
button
- Numéro du bouton sur le joystick. -
modifier
- FIXME ? aucune idée ? -
command
- Spécifie la commande à lancer quand le bouton est pressé. Voir Keyboard layout pour des descriptions et une liste de commandes.
JOYSTICK: axes
Échantillon
<axis name="x" joystick="0" axis="0" inverse="false" />
Description
-
name
- Nom de l'axe (dans le jeu) à lier (x,y,z,throttle
) -
joystick
- Numéro du joystick. -
axis
- Numéro de l'axe sur le joystick. -
inverse
- Régler ceci sur true si vous voulez inverser la direction des axes, sinon régler le sur false.
Coolie Hat/ou Hatswitch analogiques
forum link 1 Les boutons de type coolie hat (en forme de chapeau chinois, habituellement sur le sommet du joystick, que l'on peut pousser sur 4 ou 8 directions) sont maintenant souvent présents sur les joysticks.
Échantillon
<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" />
Une fois définis, les hatswitch analogiques ont leur propre numéro, et leurs "boutons" (positions) sont définis indépendamment des joysticks. Lorsque vous créez vos <bind> balises, assurez-vous de ne pas spécifier un numéro de joystick (i.e. joystick="0"); cela lierait des boutons du joystick plutôt que des positions du hatswitch.
Coolie Hat/ou Hatswitch digitaux
Échantillon
<bind joystick="0" digital-hatswitch="0" direction="up" command="ABKey"/>
Description
-
joystick
- Numéro du joystick. -
digital-hatswitch
- Numéro du hatswitch digital. -
direction
- Position (-bouton) du hatswitch digital.- Valeurs possible : "center", "up", "right", "left", "down", "rightup", "rightdown", "leftup", "leftdown"
-
command
- Spécifie la commande à lancer quand le bouton est pressé. Voir Keyboard layout pour des descriptions et une liste de commandes.
Note: Les hatswitches digitaux vont "résonner". Si vous fournissez des commandes pour "left", "up", et "leftup", bouger le hatswitch en haut à gauche activera les trois commandes.
Note (2): Le support des hatswitch digitaux est désactivé pas défaut dans l'arbre CVS. Pour l'activer, éditez votre vegastrike.config et réglez "debug_digital_hatswitch" à "true". Soyez avertis que cela enverra beaucoup de textes de débuggage à la console. Sachez aussi que vous ne pouvez actuellement pas lier de commande à "center". Les deux bugs ont été soumis avec un patch et devraient être bientôt résolus.
Axes D-PAD Digitaux utilisés comme Hatswitchs
Ceci peut permettre d'utiliser un axe (habituellement digital) tel un D-Pad, comme des boutons de commande, tels que les touches de caméra, etc.
Échantillon
<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
Dans les balises <axis> :
-
axis
- Numéro des axes du joystick axes pour haut/bas et gauche/droite. -
margin
- En gros, vous voulez y inclure 1.0 et -1.0, mais pas 0.0 lorsque vous ajoutez la marge +/- des valeurs du hatswitch. -
joystick
- 0=bas/gauche, 1=haut/droite
Dans les balises <bind>:
-
hatswitch
etnr
- Numéros des deux "hatswitchs" définis. -
button
- 0=bas/gauche, 1=haut/droite -
command
- Spécifie la commande à lancer quand le bouton est pressé. Voir Keyboard layout pour des descriptions et une liste de commandes.
Exemples de joystick
Vous pouvez insérer vos configuration qui fonctionnent ici.
Microsoft SideWinder Force Feedback Pro
(doit fonctionner aussi pour d'autres joysticks sidewinder)
Ajoutez joy_ffp
à la ligne
#cat Joystick no_joy joy_normal joy_throttle joy_axis joy_throttle_and_axis joy_t_a_rev
comme ceci
#cat Joystick no_joy joy_normal joy_throttle joy_axis joy_throttle_and_axis joy_t_a_rev joy_ffp
Ajouter le texte de description
#desc joy_ffp Microsoft SideWinder Force Feedback Pro
Faire du joystick celui par défaut
éditez la ligne #set Joystick xxxx
pour donner celle-ci :
#set Joystick joy_ffp
Code de liaisons
Placez le code ci-dessous au-dessus de la ligne </bindings>
dans le fichier vegastrike.config
. Si vous le modifiez, assurez-vous de ne pas inclure de commentaires entre les marqueurs de vssetup (#joy_ffp and #end), au risque de le casser.
FIXME Attention: Ces liaisons ne fonctionnent peut-être pas sous linux ... en tout cas ça ne fonctionne plus chez moi depuis que j'y suis passé. De l'aide est toujours bienvenue.
<!-- 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
- (kernels testés: 2.4.27)
Ce modèle se présente sous linux comme possédant 11 axes et 20 buttons, mais seulement 6 axes et 9 boutons sont utilisés, dont 2 sont pour le hatstick pseudo-analogique (qui est en réalité digital).
La configuration du hatswitch est spéciale ici. La configuration ci-dessous utilise un système "retourner au centre" :lorsqu'il est relâché, le hatswitch retourne à la vue standard du cockpit. Par conséquent, le moyen le plus évident serait de définir un axe centré sur (0) comme retournant à Cockpit::Inside. Mais lorsque cela a été défini pour les deux axes, ça n'a pas marché ; presser "gauche" ou "droite" clignotait seulement dans cette direction, retournant instantanément au centre même si le hatswitch était maintenu. C'est dû au fait que le mouvement horizontal du hatswitch (en partant du centre) déclenche aussi en quelque-sorte des événements de mouvement vertical, même si l'axe vertical n'a pas changé. Le centrage vertical venait annuler le mouvement gauche-droite.
En définissant le comportement "retourner au centre" seulement sur le mouvement horizontal, tout fonctionne parfaitement: le mouvement horizontal est libéré des événements de mouvement vertical, et renvoyer l'axe vertical au centre déclenche aussi en quelque sorte un événement de centrage horizontal, redéfinissant la vue à l'intérieur du vaisseau. La cause de cette incohérence est inconnue, mais l'effet est exactement celui qui est voulu.
Une fois les problèmes d'axes résolus, la configuration des boutons est extrêmement simple; les 8 premiers boutons (de 0 à 7) correspondent directement aux boutons du manche. Le bouton #11 est un bouton spécial virtuel qui est "pressé" quand la main quitte le manche (via un senseur optique). Atterrir dans une station spatiale est l'utilisation la plus logique de ce "bouton", car c'est à ce moment que l'utilisateur va de toute façon vouloir lâcher le joystick ; 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 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 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 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
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
- Current vegastrike.config in SVN.
Contrôles souris | Configuration avancée : contrôles et raccourcis | Config:Advanced:Colors |