summaryrefslogtreecommitdiff
path: root/src/debug/HyprCtl.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-11-18 19:56:26 +0000
committerVaxry <vaxry@vaxry.net>2024-11-18 19:56:26 +0000
commit936dfedbadbae761cd307ba7509467b55ac5e1ae (patch)
tree645f4132dc82b849c9d9ca11dae818f1c6809828 /src/debug/HyprCtl.cpp
parent6113f4da7fa9839645525e57ff841db5bb00e475 (diff)
keybinds: move to managed pointers
Diffstat (limited to 'src/debug/HyprCtl.cpp')
-rw-r--r--src/debug/HyprCtl.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index 6c9c2b75..1b94296f 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -814,28 +814,28 @@ std::string globalShortcutsRequest(eHyprCtlOutputFormat format, std::string requ
std::string bindsRequest(eHyprCtlOutputFormat format, std::string request) {
std::string ret = "";
if (format == eHyprCtlOutputFormat::FORMAT_NORMAL) {
- for (auto const& kb : g_pKeybindManager->m_lKeybinds) {
+ for (auto const& kb : g_pKeybindManager->m_vKeybinds) {
ret += "bind";
- if (kb.locked)
+ if (kb->locked)
ret += "l";
- if (kb.mouse)
+ if (kb->mouse)
ret += "m";
- if (kb.release)
+ if (kb->release)
ret += "r";
- if (kb.repeat)
+ if (kb->repeat)
ret += "e";
- if (kb.nonConsuming)
+ if (kb->nonConsuming)
ret += "n";
- if (kb.hasDescription)
+ if (kb->hasDescription)
ret += "d";
- ret += std::format("\n\tmodmask: {}\n\tsubmap: {}\n\tkey: {}\n\tkeycode: {}\n\tcatchall: {}\n\tdescription: {}\n\tdispatcher: {}\n\targ: {}\n\n", kb.modmask, kb.submap,
- kb.key, kb.keycode, kb.catchAll, kb.description, kb.handler, kb.arg);
+ ret += std::format("\n\tmodmask: {}\n\tsubmap: {}\n\tkey: {}\n\tkeycode: {}\n\tcatchall: {}\n\tdescription: {}\n\tdispatcher: {}\n\targ: {}\n\n", kb->modmask,
+ kb->submap, kb->key, kb->keycode, kb->catchAll, kb->description, kb->handler, kb->arg);
}
} else {
// json
ret += "[";
- for (auto const& kb : g_pKeybindManager->m_lKeybinds) {
+ for (auto const& kb : g_pKeybindManager->m_vKeybinds) {
ret += std::format(
R"#(
{{
@@ -855,9 +855,9 @@ std::string bindsRequest(eHyprCtlOutputFormat format, std::string request) {
"dispatcher": "{}",
"arg": "{}"
}},)#",
- kb.locked ? "true" : "false", kb.mouse ? "true" : "false", kb.release ? "true" : "false", kb.repeat ? "true" : "false", kb.longPress ? "true" : "false",
- kb.nonConsuming ? "true" : "false", kb.hasDescription ? "true" : "false", kb.modmask, escapeJSONStrings(kb.submap), escapeJSONStrings(kb.key), kb.keycode,
- kb.catchAll ? "true" : "false", escapeJSONStrings(kb.description), escapeJSONStrings(kb.handler), escapeJSONStrings(kb.arg));
+ kb->locked ? "true" : "false", kb->mouse ? "true" : "false", kb->release ? "true" : "false", kb->repeat ? "true" : "false", kb->longPress ? "true" : "false",
+ kb->nonConsuming ? "true" : "false", kb->hasDescription ? "true" : "false", kb->modmask, escapeJSONStrings(kb->submap), escapeJSONStrings(kb->key), kb->keycode,
+ kb->catchAll ? "true" : "false", escapeJSONStrings(kb->description), escapeJSONStrings(kb->handler), escapeJSONStrings(kb->arg));
}
trimTrailingComma(ret);
ret += "]";