mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-29 10:53:49 -07:00
keybinds: refactor dispatchers to be better (#7331)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user