keybinds: refactor dispatchers to be better (#7331)

This commit is contained in:
Ikalco
2024-08-24 11:45:53 -05:00
committed by GitHub
parent 82c67e61a9
commit 66586c38f5
4 changed files with 457 additions and 305 deletions

View File

@@ -194,7 +194,10 @@ APICALL bool HyprlandAPI::addDispatcher(HANDLE handle, const std::string& name,
PLUGIN->registeredDispatchers.push_back(name);
g_pKeybindManager->m_mDispatchers[name] = handler;
g_pKeybindManager->m_mDispatchers[name] = [handler](std::string arg1) -> SDispatchResult {
handler(arg1);
return {};
};
return true;
}
@@ -378,4 +381,4 @@ APICALL bool HyprlandAPI::unregisterHyprCtlCommand(HANDLE handle, SP<SHyprCtlCom
g_pHyprCtl->unregisterCommand(cmd);
return true;
}
}