summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowmacosx.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-12-20 17:44:08 +0200
committerakleshchev <117672381+akleshchev@users.noreply.github.com>2023-10-23 15:26:19 +0300
commit453a4a13f87d5cbfa6150a4f76f9e976692b54e6 (patch)
tree9f8fca6832b9115da0771a8203ba4324716c5931 /indra/llwindow/llwindowmacosx.cpp
parent9b27b6e5098aee7a050d4c3f3f14050c509f74ec (diff)
SL-13610 [MAC] WIP enable initing devices by local id
Diffstat (limited to 'indra/llwindow/llwindowmacosx.cpp')
-rw-r--r--indra/llwindow/llwindowmacosx.cpp11
1 files changed, 8 insertions, 3 deletions
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()