diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-10-04 20:07:21 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-10-04 20:07:21 +0100 |
| commit | 0d702b556d0a52f1df53ac1e52fac11b8302783b (patch) | |
| tree | 39e5f11ad37ec82248b7bbdb1ca09587dc511813 /src/debug/HyprCtl.cpp | |
| parent | 9bbae5b8e2e593b04f6505c9f35c7e9affa9ab6f (diff) | |
Add switch device handling and binds
Diffstat (limited to 'src/debug/HyprCtl.cpp')
| -rw-r--r-- | src/debug/HyprCtl.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 0795beaa..3d4b2879 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -405,6 +405,24 @@ R"#( { // remove trailing comma if (result[result.size() - 1] == ',') result.pop_back(); + result += "\n],\n"; + + result += "\"switches\": [\n"; + + for (auto& d : g_pInputManager->m_lSwitches) { + result += getFormat( +R"#( { + "address": "0x%x", + "name": "%s" + },)#", + &d, + d.pWlrDevice ? d.pWlrDevice->name : "" + ); + } + + // remove trailing comma + if (result[result.size() - 1] == ',') + result.pop_back(); result += "\n]\n"; result += "}\n"; @@ -442,6 +460,12 @@ R"#( { for (auto& d : g_pInputManager->m_lTouchDevices) { result += getFormat("\tTouch Device at %x:\n\t\t%s\n", &d, d.pWlrDevice ? d.pWlrDevice->name : ""); } + + result += "\n\nSwitches:\n"; + + for (auto& d : g_pInputManager->m_lSwitches) { + result += getFormat("\tSwitch Device at %x:\n\t\t%s\n", &d, d.pWlrDevice ? d.pWlrDevice->name : ""); + } } return result; |
