diff options
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llwindow.h | 2 | ||||
-rw-r--r-- | indra/llwindow/llwindowmacosx.cpp | 11 | ||||
-rw-r--r-- | indra/llwindow/llwindowmacosx.h | 2 | ||||
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 2 | ||||
-rw-r--r-- | indra/llwindow/llwindowwin32.h | 2 |
5 files changed, 12 insertions, 7 deletions
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 2d27092e0a..8ee06a2cc1 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -197,7 +197,7 @@ public: // windows only DirectInput8 for joysticks virtual void* getDirectInput8() { return NULL; }; virtual bool getInputDevices(U32 device_type_filter, - std::function<void(std::string&, LLSD::Binary&, void*)> osx_callback, + std::function<bool(std::string&, LLSD::Binary&, void*)> osx_callback, void* win_callback, void* userdata) { diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index bd13138a7d..914e590ae9 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -2058,10 +2058,11 @@ static void get_devices(std::list<HidDevice> &list_of_devices, } bool LLWindowMacOSX::getInputDevices(U32 device_type_filter, - std::function<void(std::string&, LLSD::Binary&, void*)> osx_callback, + std::function<bool(std::string&, LLSD::Binary&, void*)> osx_callback, void* win_callback, void* userdata) { + bool return_value = false; CFMutableDictionaryRef device_dict_ref; IOReturn result = kIOReturnSuccess; // assume success( optimist! ) @@ -2098,12 +2099,16 @@ bool LLWindowMacOSX::getInputDevices(U32 device_type_filter, memcpy(&data[0], &iter->mlocalID, size); std::string label(iter->mProduct); - osx_callback(label, data, userdata); + if (osx_callback(label, data, userdata)) + { + break; //found device + } } + return_value = true; } CFRelease( device_dict_ref ); - return false; // todo: should be true once UI part gets done + return return_value; } LLSD LLWindowMacOSX::getNativeKeyData() diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index cec4f86b25..679bb13335 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -114,7 +114,7 @@ public: F32 getSystemUISize() override; bool getInputDevices(U32 device_type_filter, - std::function<void(std::string&, LLSD::Binary&, void*)> osx_callback, + std::function<bool(std::string&, LLSD::Binary&, void*)> osx_callback, void* win_callback, void* userdata) override; diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index b959c03406..3c7922648b 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -4496,7 +4496,7 @@ void* LLWindowWin32::getDirectInput8() } bool LLWindowWin32::getInputDevices(U32 device_type_filter - std::function<void(std::string&, LLSD::Binary&, void*)> osx_callback, + std::function<bool(std::string&, LLSD::Binary&, void*)> osx_callback, void * di8_devices_callback, void* userdata) { diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 6fbb956539..dcefe6dab2 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -130,7 +130,7 @@ public: /*virtual*/ void* getDirectInput8(); /*virtual*/ bool getInputDevices(U32 device_type_filter, - std::function<void(std::string&, LLSD::Binary&, void*)> osx_callback, + std::function<bool(std::string&, LLSD::Binary&, void*)> osx_callback, void* win_callback, void* userdata); |