]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/fgjs.cxx
throw an exception if not even a default joystick could be found;
[flightgear.git] / src / Input / fgjs.cxx
index 691c9df1a09e72e372199c4ccb9b1646e6228b6a..a98429c0b2f65a480b4f5cc76580db3d5f0d5322 100644 (file)
 
 #include <jsinput.h>
 
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
 SG_USING_STD(fstream);
 SG_USING_STD(cout);
 SG_USING_STD(endl);
 SG_USING_STD(ios);
-#endif
 SG_USING_STD(string);
 
-#if defined(_MSC_VER) || defined(__MINGW32__)
-#define snprintf _snprintf
-#endif
-
 string axes_humannames[8] = { "elevator", "ailerons", "rudder", "throttle", 
                               "mixture","propller pitch", "lateral view", 
                               "longitudinal view" 
                             };
 
-string axes_propnames[8]={ "/controls/elevator","/controls/aileron",
-                           "/controls/rudder","/controls/throttle",
-                           "/controls/mixture","/controls/pitch", 
+string axes_propnames[8]={ "/controls/flight/elevator","/controls/flight/aileron",
+                           "/controls/flight/rudder","/controls/engines/engine/throttle",
+                           "/controls/engines/engine/mixture","/controls/engines/engine/pitch", 
                            "/sim/views/axes/lat","/sim/views/axes/long" 
                          };
                       
 bool half_range[8]={ false,false,false,true,true,true,false,false };
 
 
-string button_humannames[7]= { "apply all brakes", "apply left brake", 
+string button_humannames[6]= { "apply left brake", 
                                "apply right brake", "step flaps up", 
                                "step flaps down","apply nose-up trim",
                                "apply nose-down trim"
                              }; 
 
-string button_propnames[7]={ "/controls/brakes/all", "/controls/brakes[0]",
-                             "/controls/brakes[1]", "/controls/flaps",
-                             "/controls/flaps","/controls/elevator-trim",
-                             "/controls/elevator-trim" 
+string button_propnames[6]={ "/controls/gear/brake-left",
+                             "/controls/gear/brake-right",
+                             "/controls/flight/flaps",
+                             "/controls/flight/flaps",
+                             "/controls/flight/elevator-trim",
+                             "/controls/flight/elevator-trim" 
                            };                                                   
  
 
-float button_step[7]={ 1.0, 1.0, 1.0, 0.34, -0.34, 0.001, -0.001 };
+float button_step[6]={ 1.0, 1.0, 0.34, -0.34, 0.001, -0.001 };
 
-string button_repeat[7]={ "false", "false", "false", "false", "false", 
+string button_repeat[6]={ "false", "false", "false", "false", 
                           "true", "true" };
 
 
@@ -125,6 +121,8 @@ void writeButtonProperties(fstream &fs, int property,int joystick, int button) {
 
       
 int main(void) {
+  jsInit();
+
   jsSuper *jss=new jsSuper();
   jsInput *jsi=new jsInput(jss);
   jsi->displayValues(false);
@@ -172,7 +170,7 @@ int main(void) {
       cout << endl;
   }
   
-  for(control=0;control<=6;control++) {
+  for(control=0;control<=5;control++) {
       cout << "Press the button you wish to use to " 
            << button_humannames[control]
            << endl;