Es/Joystick: Difference between revisions

Jump to navigation Jump to search
Line 90: Line 90:
Cuando mueves algun control, los numeros cambian después de pulsar cualquier boton o mover el control correspondiente, el “off” cambia a “on” después de pulsar el botón correspondiente. De esta forma, puedes anotar rápidamente los numeros de eje y de botón para cada función sin liarte con el binario.
Cuando mueves algun control, los numeros cambian después de pulsar cualquier boton o mover el control correspondiente, el “off” cambia a “on” después de pulsar el botón correspondiente. De esta forma, puedes anotar rápidamente los numeros de eje y de botón para cada función sin liarte con el binario.


===Writing or editing joystick binding xml files===
===Escibir o editar los archivos xml de interconexión de Joystick===
At this point, you have confirmed that the operating system and the joystick driver both recognize your joystick(s). You also know of several ways to identify the joystick “name” your joystick reports to the driver and operating system. You will need a written list of what control functions you wish to have assigned to which axis and button and the corresponding numbers.  
En este punto, tienes confirmado que ambos, sistema operativo y driver reconocen tu(s) joystick(s). Tambien conoces varias formas de identificar el “nombre” de tu palanca de control que el joystick reporta al driver y al sistema operativo. Necesitarás una lista escrita de que función de control deseas tener asignada a cada eje y botón y sus correspondientes numeros.  


Make the following table from what you learned from js demo or jstest above (pencil and paper is fine). Here we assume there are 5 axes including 2 axes associated with the hat.  
Haciendo la siguiente tabla con lo que has aprendido arriba sobre js demo o jstest (lapiz y papel serán útiles). Aqui asumimos que hay 5 ejes incluyendo 2 ejes asociados al pivote (hat).  


{| class="prettytable"
{| class="prettytable"
Line 124: Line 124:
|}
|}


We will assume that our hypothetical joystick supplies the “name” QUICK STICK 3D USB to the system and driver. With all the examples included with FlightGear, the easiest way to get a so far unsupported joystick to be auto detected, is to edit an existing binding xml file. Look at the xml files in the sub-folders of '''/FlightGear/Input/Joysticks/'''. After evaluating several of the xml binding files supplied with FlightGear, we decide to edit the file
Asumiremos que tu hipotético mando de control indica el “nombre” QUICK STICK 3D USB al sistema y al driver. Con todos los ejemplos incluidos en FlightGear, la manera más fácil de autodetectar una palanca de control no soportada, es editando un archivo xml de interconexión existente. Mira en los archivos xml en las sub-carpetas  '''/FlightGear/Input/Joysticks/'''. Despues de evaluar varios de los archivos xml de interconexión incluidos en FlightGear, decidimos editar el archivo


'''/FlightGear/Input/Joysticks/Saitek/Cyborg-Gold-3d-USB.xml.'''  
'''/FlightGear/Input/Joysticks/Saitek/Cyborg-Gold-3d-USB.xml.'''  


This file has all the axes functions above assigned to axes and all the button functions above assigned to buttons. This makes our editing almost trivial.  
Este archivo tiene todas las funciones de eje y todas las funciones de botones arriba asignadas. Esto hace que nuestra edición sea casi trivial.  


Before we begin to edit, we need to choose a name for our bindings xml file, create the folder for the QS joysticks, and copy the original xml file into this directory with this name.  
Antes de que comencemos a editar, necesitamos elegir un nombre para nuestro archivo xml de interconexión, crear la carpeta para el joystick QS, y copiar el archivo xml original en el directorio con este nombre.  


  $ cd /usr/local/FlightGear/Input/Joysticks  
  $ cd /usr/local/FlightGear/Input/Joysticks  
Line 138: Line 138:
  Cyborg-Gold-3d-USB.xml QuickStick.xml  
  Cyborg-Gold-3d-USB.xml QuickStick.xml  


Here, we obviously have supposed a Linux/UNIX system with FlightGear being installed under '''/usr/local/FlightGear'''. For a similar procedure under Windows with FlightGear being installed under c:FlightGear, open a command shell and type
Aquí, obviamente hemos supuesto un sistema GNU/Linux/UNIX con FlightGear estando instalado en '''/usr/local/FlightGear'''. Para un procedimiento similar bajo Windows con FlightGear estando instalado en c:FlightGear, abre la ventana de comandos y escribe


  c:  
  c:  
Line 147: Line 147:
  Cyborg-Gold-3d-USB.xml QuickStick.xml  
  Cyborg-Gold-3d-USB.xml QuickStick.xml  


Next, open QuickStick.xml with your favorite editor. Before we forget to change the joystick name, search for the line containing <name>. You should find the line
Lo siguiente, abre QuickStick.xml con tu editor favorito. Antes de que olvidemos cambiar el nombre de la palanca de control, busca la linea que contenga <name>. Deberás encontrar la línea


'''<name>SAITEK CYBORG 3D USB</name>'''  
'''<name>SAITEK CYBORG 3D USB</name>'''  


and change it to
y cambiarla por


'''<name>QUICK STICK 3D USB</name>.'''  
'''<name>QUICK STICK 3D USB</name>.'''  


This line illustrates a key feature of xml statements. They begin with a <tag> and end with a </tag>.  
Esta línea ilustra la clave interpretada por los comandos xml. Empezarán con una etiqueta<tag> y finalizarán con otra etiqueta de cierre</tag>.  


You can now compare your table to the comment table at the top of your file copy. Note that the comments tell us that the Saitek elevator was assigned to axis 1. Search for the string
Ahora puedes comparar tu tabla con la tabla comentada en la parte de arriba de tu copia de archivo. Haz notar que los comentarios nos dicen que el elevador Saitek fué asignado al eje 1. Busca la cadena


'''<axis n=~1~>'''  
'''<axis n=~1~>'''  


and change this to
y cambia esta por


'''<axis n=~0~>.'''  
'''<axis n=~0~>.'''  


Next, note that the Saitek rudder was assigned to axis 2. Search for the string
Lo siguiente, haz notar que el timon de dirección Saitek fué asignado al eje 2. Busca la cadena


'''<axis n=~2~>'''  
'''<axis n=~2~>'''  


and change this to
y cambia esta por


'''<axis n=~1~>.'''  
'''<axis n=~1~>.'''  


Continue comparing your table with the comment table for the Saitek and changing the axis numbers and button numbers accordingly. Since QUICKSTICK USB and the Saitek have the same number of axes but different number of buttons, you must delete the buttons left over. Just remember to double check that you have a closing tag for each opening tag or you will get an error using the file.  
Continua comparando tu tabla con la tabla comentada del Saitek y cambia los numeros de eje y los numeros de botón correspondientes. Desde que el QUICKSTICK USB y el Saitek tienen el mismo numero de ejes pero diferentes numeros de botones, debes borrar los botonos sobrantes. Recuerda que tienes que comprobar que tienes las etiquetas de cierre de todas las etiquetas abiertas o recibirás un error usando el archivo.  


Finally, be good to yourself (and others when you submit your new binding file to a FlightGear developers or users archive!), take the time to change the comment table in the edited file to match your changed axis and button assignments. The new comments should match the table you made from the js demo output. Save your edits.  
Finalmente, se bueno contigo mismo (y con los otros cuando submitas tu nuevo archivo de interconexión a los desarrolladores de FlightGear o a los archivos de usuario!), tomate el tiempo de cambiar la tabla comentada del archivo editado para marcar tus cambios de eje y las asignaciones de botón. Los nuevos comentarios corresponderán a la tabla que has hecho por la salida dada por js demo. Salva tu edición.  


Several users have reported that the numbers of axes and buttons assigned to functions may be different with the same joystick under Windows and Linux. The above procedure should allow one to easily change a binding xml file created for a different operating system for use by their operating system.
Varios usuarios han reportado que los numeros de eje y botones asignados a funciones pueden ser diferentes con el mismo joystick en Windows o en GNU/Linux. El procedimiento de arriba permitiria a cada uno cambiar facilmente el archivo de interconexión xml creado para usar en los diferentes sistemas operativos.


===Telling FlightGear about your new bindings xml file===
===Telling FlightGear about your new bindings xml file===
5,810

edits

Navigation menu