mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 00:09:49 +01:00
Added bindl
This commit is contained in:
parent
48e33023af
commit
5541098f20
4 changed files with 8 additions and 8 deletions
|
@ -415,7 +415,7 @@ void CConfigManager::handleAnimation(const std::string& command, const std::stri
|
||||||
configSetValueSafe("animations:" + ANIMNAME + "_style", curitem);
|
configSetValueSafe("animations:" + ANIMNAME + "_style", curitem);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CConfigManager::handleBind(const std::string& command, const std::string& value) {
|
void CConfigManager::handleBind(const std::string& command, const std::string& value, bool locked) {
|
||||||
// example:
|
// example:
|
||||||
// bind=SUPER,G,exec,dmenu_run <args>
|
// bind=SUPER,G,exec,dmenu_run <args>
|
||||||
|
|
||||||
|
@ -448,7 +448,7 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v
|
||||||
}
|
}
|
||||||
|
|
||||||
if (KEY != "")
|
if (KEY != "")
|
||||||
g_pKeybindManager->addKeybind(SKeybind{KEY, MOD, HANDLER, COMMAND});
|
g_pKeybindManager->addKeybind(SKeybind{KEY, MOD, HANDLER, COMMAND, locked});
|
||||||
}
|
}
|
||||||
|
|
||||||
void CConfigManager::handleUnbind(const std::string& command, const std::string& value) {
|
void CConfigManager::handleUnbind(const std::string& command, const std::string& value) {
|
||||||
|
@ -578,6 +578,7 @@ std::string CConfigManager::parseKeyword(const std::string& COMMAND, const std::
|
||||||
}
|
}
|
||||||
else if (COMMAND == "monitor") handleMonitor(COMMAND, VALUE);
|
else if (COMMAND == "monitor") handleMonitor(COMMAND, VALUE);
|
||||||
else if (COMMAND == "bind") handleBind(COMMAND, VALUE);
|
else if (COMMAND == "bind") handleBind(COMMAND, VALUE);
|
||||||
|
else if (COMMAND == "bindl") handleBind(COMMAND, VALUE, true);
|
||||||
else if (COMMAND == "unbind") handleUnbind(COMMAND, VALUE);
|
else if (COMMAND == "unbind") handleUnbind(COMMAND, VALUE);
|
||||||
else if (COMMAND == "workspace") handleDefaultWorkspace(COMMAND, VALUE);
|
else if (COMMAND == "workspace") handleDefaultWorkspace(COMMAND, VALUE);
|
||||||
else if (COMMAND == "windowrule") handleWindowRule(COMMAND, VALUE);
|
else if (COMMAND == "windowrule") handleWindowRule(COMMAND, VALUE);
|
||||||
|
|
|
@ -106,7 +106,7 @@ private:
|
||||||
void configSetValueSafe(const std::string&, const std::string&);
|
void configSetValueSafe(const std::string&, const std::string&);
|
||||||
void handleRawExec(const std::string&, const std::string&);
|
void handleRawExec(const std::string&, const std::string&);
|
||||||
void handleMonitor(const std::string&, const std::string&);
|
void handleMonitor(const std::string&, const std::string&);
|
||||||
void handleBind(const std::string&, const std::string&);
|
void handleBind(const std::string&, const std::string&, bool locked = false);
|
||||||
void handleUnbind(const std::string&, const std::string&);
|
void handleUnbind(const std::string&, const std::string&);
|
||||||
void handleWindowRule(const std::string&, const std::string&);
|
void handleWindowRule(const std::string&, const std::string&);
|
||||||
void handleDefaultWorkspace(const std::string&, const std::string&);
|
void handleDefaultWorkspace(const std::string&, const std::string&);
|
||||||
|
|
|
@ -72,13 +72,11 @@ bool CKeybindManager::handleKeybinds(const uint32_t& modmask, const xkb_keysym_t
|
||||||
if (handleInternalKeybinds(key))
|
if (handleInternalKeybinds(key))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (g_pCompositor->m_sSeat.exclusiveClient){
|
if (g_pCompositor->m_sSeat.exclusiveClient)
|
||||||
Debug::log(LOG, "Not handling keybinds due to there being an exclusive inhibited client.");
|
Debug::log(LOG, "Keybind handling only locked (inhibitor)");
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto& k : m_lKeybinds) {
|
for (auto& k : m_lKeybinds) {
|
||||||
if (modmask != k.modmask)
|
if (modmask != k.modmask || (g_pCompositor->m_sSeat.exclusiveClient && !k.locked))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// oMg such performance hit!!11!
|
// oMg such performance hit!!11!
|
||||||
|
|
|
@ -11,6 +11,7 @@ struct SKeybind {
|
||||||
uint32_t modmask = 0;
|
uint32_t modmask = 0;
|
||||||
std::string handler = "";
|
std::string handler = "";
|
||||||
std::string arg = "";
|
std::string arg = "";
|
||||||
|
bool locked = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CKeybindManager {
|
class CKeybindManager {
|
||||||
|
|
Loading…
Reference in a new issue