]> git.mxchange.org Git - flightgear.git/commitdiff
In joystick configurations, fall back to <unix> if no <mac> entry was provided, since...
authorJames Turner <zakalawe@mac.com>
Thu, 15 Sep 2011 08:54:00 +0000 (09:54 +0100)
committerJames Turner <zakalawe@mac.com>
Thu, 15 Sep 2011 08:54:00 +0000 (09:54 +0100)
src/Input/CMakeLists.txt
src/Input/FGJoystickInput.cxx

index eb9916107ac11ecaba49bd30dfa6fbecf5fe1ad5..4c5939d4af7eaf80d135b2e30fc0b24ea17ec3bc 100644 (file)
@@ -18,6 +18,17 @@ set(SOURCES
        input.cxx       
        )
        
+set(HEADERS
+       FGButton.hxx
+    FGCommonInput.hxx
+    FGDeviceConfigurationMap.hxx
+    FGEventInput.hxx
+    FGJoystickInput.hxx
+    FGKeyboardInput.hxx
+    FGMouseInput.hxx
+    input.hxx
+       )
+       
 if(EVENT_INPUT)
        list(APPEND SOURCES ${EVENT_INPUT_SOURCES})
        include_directories(${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR})
@@ -43,6 +54,6 @@ target_link_libraries(js_demo
        ${PLIB_LIBRARIES}
        ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES})
 
-flightgear_component(Input "${SOURCES}")
+flightgear_component(Input "${SOURCES}" "${HEADERS}")
 
 install(TARGETS fgjs js_demo RUNTIME DESTINATION bin)
index 45674764732dd1bb10bdc7000cc76338f5d6edb2..516679f25136565358ccbfbde3d1ac1c0b542f8a 100644 (file)
@@ -217,10 +217,19 @@ void FGJoystickInput::postinit()
       if (num_node != 0) {
           n_axis = num_node->getIntValue(TGT_PLATFORM, -1);
 
+        #ifdef SG_MAC
+          // Mac falls back to Unix by default - avoids specifying many
+          // duplicate <mac> entries in joystick config files
+          if (n_axis < 0) {
+              n_axis = num_node->getIntValue("unix", -1);
+          }
+        #endif
+          
           // Silently ignore platforms that are not specified within the
           // <number></number> section
-          if (n_axis < 0)
-             continue;
+          if (n_axis < 0) {
+              continue;
+          }
       }
 
       if (n_axis >= naxes) {