summaryrefslogtreecommitdiff
path: root/hyprtester/src/tests/main/keybinds.cpp
diff options
context:
space:
mode:
authorMr. Goferito <goferito@gmail.com>2025-12-26 23:16:31 +0100
committerGitHub <noreply@github.com>2025-12-26 23:16:31 +0100
commitd7f26038ee2b44f3d02fe2a7556bafb91a02f46e (patch)
tree19fdece1f863bcd549ca36f175f9c543edf66a26 /hyprtester/src/tests/main/keybinds.cpp
parent33df518f97b930316742736ecb07dc322da4c5d3 (diff)
keybinds: fix multikey binds breaking after scroll wheel events (#12638)
Diffstat (limited to 'hyprtester/src/tests/main/keybinds.cpp')
-rw-r--r--hyprtester/src/tests/main/keybinds.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/hyprtester/src/tests/main/keybinds.cpp b/hyprtester/src/tests/main/keybinds.cpp
index 23f17abf..a87a8b07 100644
--- a/hyprtester/src/tests/main/keybinds.cpp
+++ b/hyprtester/src/tests/main/keybinds.cpp
@@ -456,6 +456,35 @@ static void testSubmap() {
Tests::killAllWindows();
}
+static void testBindsAfterScroll() {
+ NLog::log("{}Testing binds after scroll", Colors::GREEN);
+
+ clearFlag();
+ OK(getFromSocket("/keyword binds Alt_R,w,exec,touch " + flagFile));
+
+ // press keybind before scroll
+ OK(getFromSocket("/dispatch plugin:test:keybind 1,0,108")); // Alt_R press
+ OK(getFromSocket("/dispatch plugin:test:keybind 1,4,25")); // w press
+ EXPECT(attemptCheckFlag(20, 50), true);
+ OK(getFromSocket("/dispatch plugin:test:keybind 0,4,25")); // w release
+ OK(getFromSocket("/dispatch plugin:test:keybind 0,0,108")); // Alt_R release
+
+ // scroll
+ OK(getFromSocket("/dispatch plugin:test:scroll 120"));
+ OK(getFromSocket("/dispatch plugin:test:scroll -120"));
+ OK(getFromSocket("/dispatch plugin:test:scroll 120"));
+
+ // press keybind after scroll
+ OK(getFromSocket("/dispatch plugin:test:keybind 1,0,108")); // Alt_R press
+ OK(getFromSocket("/dispatch plugin:test:keybind 1,4,25")); // w press
+ EXPECT(attemptCheckFlag(20, 50), true);
+ OK(getFromSocket("/dispatch plugin:test:keybind 0,4,25")); // w release
+ OK(getFromSocket("/dispatch plugin:test:keybind 0,0,108")); // Alt_R release
+
+ clearFlag();
+ OK(getFromSocket("/keyword unbind Alt_R,w"));
+}
+
static void testSubmapUniversal() {
NLog::log("{}Testing submap universal", Colors::GREEN);
@@ -507,6 +536,7 @@ static bool test() {
testShortcutRepeatKeyRelease();
testSubmap();
testSubmapUniversal();
+ testBindsAfterScroll();
clearFlag();
return !ret;