diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-02-24 22:57:45 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-02-24 22:58:38 +0200 |
commit | 696795a368a8825fb083627e39f65dcc30266122 (patch) | |
tree | e73d4556cbcfe03dc28f54fd153ce2c9c6b5bd8b /indra/newview | |
parent | 71242b2cc63d8f3289c70f0770c665b8ba5d6f84 (diff) |
SL-16910 Fix Mac not selecting a joystick
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterjoystick.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp index 93a26f31cc..558b14bba7 100644 --- a/indra/newview/llfloaterjoystick.cpp +++ b/indra/newview/llfloaterjoystick.cpp @@ -292,7 +292,7 @@ void LLFloaterJoystick::refreshListOfDevices() std::string desc = LLViewerJoystick::getInstance()->getDescription(); if (!desc.empty()) { - LLSD value = LLSD::Integer(0); + LLSD value = LLSD::Integer(1); // value for selection addDevice(desc, value); mHasDeviceList = true; } @@ -392,6 +392,9 @@ void LLFloaterJoystick::onCommitJoystickEnabled(LLUICtrl*, void *joy_panel) LLSD value = self->mJoysticksCombo->getValue(); bool joystick_enabled = true; + // value is 0 for no device, + // 1 for a device on Mac (single device, no list support yet) + // binary packed guid for a device on windows (can have multiple devices) if (value.isInteger()) { // ndof already has a device selected, we are just setting it enabled or disabled @@ -400,7 +403,7 @@ void LLFloaterJoystick::onCommitJoystickEnabled(LLUICtrl*, void *joy_panel) else { LLViewerJoystick::getInstance()->initDevice(value); - // else joystick is enabled, because combobox holds id of device + // else joystick is enabled, because combobox holds id of the device joystick_enabled = true; } gSavedSettings.setBOOL("JoystickEnabled", joystick_enabled); |