]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/fgjs.cxx
- adjusted for no-value constructor for FGPanel
[flightgear.git] / src / Input / fgjs.cxx
index a17d71a2b30dbcaa336283259d59e30e69982ee3..59ea34a9b24a262c5c59558e2c913f2c6b7dd921 100644 (file)
@@ -26,7 +26,6 @@
 #include STL_FSTREAM
 #include STL_STRING
 
-#include <jssuper.h>
 #include <jsinput.h>
 
 SG_USING_STD(string);
@@ -52,8 +51,8 @@ string button_humannames[7]= { "apply all brakes", "apply left brake",
                                "apply nose-down trim"
                              }; 
 
-string button_propnames[7]={ "/controls/brakes/all", "/controls/brakes/left",
-                             "/controls/brakes/right", "/controls/flaps",
+string button_propnames[7]={ "/controls/brakes/all", "/controls/brakes[0]",
+                             "/controls/brakes[1]", "/controls/flaps",
                              "/controls/flaps","/controls/elevator-trim",
                              "/controls/elevator-trim" 
                            };                                                   
@@ -84,8 +83,8 @@ void waitForButton(jsSuper *jss, int wait_ms) {
 
 void writeAxisProperties(fstream &fs, int control,int joystick, int axis) {
      
-     char jsDesc[25];
-     snprintf(jsDesc,25,"--prop:/input/js%d/axis%d",joystick,axis);
+     char jsDesc[40];
+     snprintf(jsDesc,40,"--prop:/input/joysticks/js[%d]/axis[%d]",joystick,axis);
      fs << jsDesc  << "/control=" << axes_propnames[control] << endl; 
      
      fs << jsDesc << "/dead-band=0.02"  << endl; 
@@ -102,8 +101,8 @@ void writeAxisProperties(fstream &fs, int control,int joystick, int axis) {
 
 void writeButtonProperties(fstream &fs, int property,int joystick, int button) {
      
-     char jsDesc[25];
-     snprintf(jsDesc,25,"--prop:/input/js%d/button%d",joystick,button);
+     char jsDesc[40];
+     snprintf(jsDesc,40,"--prop:/input/joysticks/js[%d]/button[%d]",joystick,button);
      
      fs << jsDesc << "/action=adjust" << endl; 
      fs << jsDesc << "/control=" << button_propnames[property] << endl;
@@ -119,7 +118,7 @@ int main(void) {
   jsSuper *jss=new jsSuper();
   jsInput *jsi=new jsInput(jss);
   jsi->displayValues(false);
-  int i;
+  // int i;
   int control=0;
   
   
@@ -202,6 +201,3 @@ int main(void) {
      
   return 1;
 }      
-  
-
-