keybinds: refactor dispatchers to be better (#7331)
This commit is contained in:
parent
82c67e61a9
commit
66586c38f5
4 changed files with 457 additions and 305 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue