summaryrefslogtreecommitdiff
path: root/src/debug/HyprCtl.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-09-02 13:16:43 +0200
committerGitHub <noreply@github.com>2025-09-02 13:16:43 +0200
commit127aab815908ecbd3db4d23f127d2e96b79855f9 (patch)
tree289ee3e7c9be70c3b45ff91a693b33fe7598502a /src/debug/HyprCtl.cpp
parent78e86d879fa9bf3afeb73b29a3e668d47df5e9ab (diff)
input: add per-device scroll-factor (#11241)
Diffstat (limited to 'src/debug/HyprCtl.cpp')
-rw-r--r--src/debug/HyprCtl.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index a9388789..8598b1f6 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -722,10 +722,11 @@ static std::string devicesRequest(eHyprCtlOutputFormat format, std::string reque
R"#( {{
"address": "0x{:x}",
"name": "{}",
- "defaultSpeed": {:.5f}
+ "defaultSpeed": {:.5f},
+ "scrollFactor": {:.2f}
}},)#",
rc<uintptr_t>(m.get()), escapeJSONStrings(m->m_hlName),
- m->aq() && m->aq()->getLibinputHandle() ? libinput_device_config_accel_get_default_speed(m->aq()->getLibinputHandle()) : 0.f);
+ m->aq() && m->aq()->getLibinputHandle() ? libinput_device_config_accel_get_default_speed(m->aq()->getLibinputHandle()) : 0.f, m->m_scrollFactor.value_or(-1));
}
trimTrailingComma(result);
@@ -826,8 +827,9 @@ static std::string devicesRequest(eHyprCtlOutputFormat format, std::string reque
result += "mice:\n";
for (auto const& m : g_pInputManager->m_pointers) {
- result += std::format("\tMouse at {:x}:\n\t\t{}\n\t\t\tdefault speed: {:.5f}\n", rc<uintptr_t>(m.get()), m->m_hlName,
- (m->aq() && m->aq()->getLibinputHandle() ? libinput_device_config_accel_get_default_speed(m->aq()->getLibinputHandle()) : 0.f));
+ result += std::format("\tMouse at {:x}:\n\t\t{}\n\t\t\tdefault speed: {:.5f}\n\t\t\tscroll factor: {:.2f}\n", rc<uintptr_t>(m.get()), m->m_hlName,
+ (m->aq() && m->aq()->getLibinputHandle() ? libinput_device_config_accel_get_default_speed(m->aq()->getLibinputHandle()) : 0.f),
+ m->m_scrollFactor.value_or(-1));
}
result += "\n\nKeyboards:\n";