summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterjoystick.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterjoystick.cpp')
-rw-r--r--indra/newview/llfloaterjoystick.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp
index 558b14bba7..5265411e54 100644
--- a/indra/newview/llfloaterjoystick.cpp
+++ b/indra/newview/llfloaterjoystick.cpp
@@ -250,6 +250,12 @@ void LLFloaterJoystick::refresh()
initFromSettings();
}
+void LLFloaterJoystick::addDeviceCallback(std::string &name, LLSD::Binary& value, void* userdata)
+{
+ LLFloaterJoystick * floater = (LLFloaterJoystick*)userdata;
+ floater->mJoysticksCombo->add(name, value, ADD_BOTTOM, 1);
+}
+
void LLFloaterJoystick::addDevice(std::string &name, LLSD& value)
{
mJoysticksCombo->add(name, value, ADD_BOTTOM, 1);
@@ -264,19 +270,21 @@ void LLFloaterJoystick::refreshListOfDevices()
mHasDeviceList = false;
+ void* win_calback = nullptr;
// di8_devices_callback callback is immediate and happens in scope of getInputDevices()
#if LL_WINDOWS && !LL_MESA_HEADLESS
// space navigator is marked as DI8DEVCLASS_GAMECTRL in ndof lib
U32 device_type = DI8DEVCLASS_GAMECTRL;
- void* callback = &di8_list_devices_callback;
+ win_calback = di8_list_devices_callback;
+#elif LL_DARWIN
+ U32 device_type = 0;
#else
// MAC doesn't support device search yet
// On MAC there is an ndof_idsearch and it is possible to specify product
// and manufacturer in NDOF_Device for ndof_init_first to pick specific one
U32 device_type = 0;
- void* callback = NULL;
#endif
- if (gViewerWindow->getWindow()->getInputDevices(device_type, callback, this))
+ if (gViewerWindow->getWindow()->getInputDevices(device_type, addDeviceCallback, win_calback, this))
{
mHasDeviceList = true;
}