aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerjoystick.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llviewerjoystick.cpp')
-rw-r--r--linden/indra/newview/llviewerjoystick.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/linden/indra/newview/llviewerjoystick.cpp b/linden/indra/newview/llviewerjoystick.cpp
index e9690f8..cf9d8a1 100644
--- a/linden/indra/newview/llviewerjoystick.cpp
+++ b/linden/indra/newview/llviewerjoystick.cpp
@@ -228,8 +228,38 @@ void LLViewerJoystick::init(bool autoenable)
228 mDriverState = JDS_UNINITIALIZED; 228 mDriverState = JDS_UNINITIALIZED;
229 } 229 }
230 } 230 }
231
232 // Autoenable the joystick for recognized devices if nothing was connected previously
233 if (!autoenable)
234 {
235 autoenable = gSavedSettings.getString("JoystickInitialized").empty() ? true : false;
236 }
231 updateEnabled(autoenable); 237 updateEnabled(autoenable);
232 238
239 if (mDriverState == JDS_INITIALIZED)
240 {
241 // A Joystick device is plugged in
242 if (isLikeSpaceNavigator())
243 {
244 // It's a space navigator, we have defaults for it.
245 if (gSavedSettings.getString("JoystickInitialized") != "SpaceNavigator")
246 {
247 // Only set the defaults if we haven't already (in case they were overridden)
248 setSNDefaults();
249 gSavedSettings.setString("JoystickInitialized", "SpaceNavigator");
250 }
251 }
252 else
253 {
254 // It's not a Space Navigator
255 gSavedSettings.setString("JoystickInitialized", "UnknownDevice");
256 }
257 }
258 else
259 {
260 // No device connected, don't change any settings
261 }
262
233 llinfos << "ndof: mDriverState=" << mDriverState << "; mNdofDev=" 263 llinfos << "ndof: mDriverState=" << mDriverState << "; mNdofDev="
234 << mNdofDev << "; libinit=" << libinit << llendl; 264 << mNdofDev << "; libinit=" << libinit << llendl;
235#endif 265#endif