diff options
| author | Moritz G <100203892+Moerliy@users.noreply.github.com> | 2024-06-11 19:49:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-11 19:49:54 +0200 |
| commit | e1b05f8eafd8cd3e7e9197fa1db92391174b9206 (patch) | |
| tree | d8655934668766dd4a19ac71ebd92a04334cdf24 /src/debug/HyprCtl.cpp | |
| parent | 21b9e31bf432e3d58f408b83e7dd15b653b49494 (diff) | |
binds: Add description to key binds (#6358)
---------
Co-authored-by: Yusuf Duran <firatyusuf.d@gmail.com>
Diffstat (limited to 'src/debug/HyprCtl.cpp')
| -rw-r--r-- | src/debug/HyprCtl.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 6f4d74b7..a7e714bd 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -1,5 +1,6 @@ #include "HyprCtl.hpp" +#include <format> #include <netinet/in.h> #include <stdio.h> #include <stdlib.h> @@ -28,6 +29,7 @@ using namespace Hyprutils::String; #include "../devices/ITouch.hpp" #include "../devices/Tablet.hpp" #include "config/ConfigManager.hpp" +#include "helpers/MiscFunctions.hpp" static void trimTrailingComma(std::string& str) { if (!str.empty() && str.back() == ',') @@ -792,9 +794,11 @@ std::string bindsRequest(eHyprCtlOutputFormat format, std::string request) { ret += "e"; if (kb.nonConsuming) ret += "n"; + if (kb.hasDescription) + ret += "d"; - ret += std::format("\n\tmodmask: {}\n\tsubmap: {}\n\tkey: {}\n\tkeycode: {}\n\tcatchall: {}\n\tdispatcher: {}\n\targ: {}\n\n", kb.modmask, kb.submap, kb.key, - kb.keycode, kb.catchAll, 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 @@ -808,17 +812,19 @@ std::string bindsRequest(eHyprCtlOutputFormat format, std::string request) { "release": {}, "repeat": {}, "non_consuming": {}, + "has_description": {}, "modmask": {}, "submap": "{}", "key": "{}", "keycode": {}, "catch_all": {}, + "description": "{}", "dispatcher": "{}", "arg": "{}" }},)#", kb.locked ? "true" : "false", kb.mouse ? "true" : "false", kb.release ? "true" : "false", kb.repeat ? "true" : "false", kb.nonConsuming ? "true" : "false", - kb.modmask, escapeJSONStrings(kb.submap), escapeJSONStrings(kb.key), kb.keycode, kb.catchAll ? "true" : "false", escapeJSONStrings(kb.handler), - escapeJSONStrings(kb.arg)); + 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 += "]"; |
