diff options
| author | ArchSav <96357545+ArchSav@users.noreply.github.com> | 2026-03-14 00:48:01 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-13 08:48:01 -0500 |
| commit | 24a95621e5118e39e1a6e05b17ef89f4ec2c8c01 (patch) | |
| tree | a37133cd549fb7107ebbaa5bf60fafd52a5bdd77 /hyprtester/src/tests/main/keybinds.cpp | |
| parent | e8684034525829d58054c32da914d1713398fbb8 (diff) | |
input: add device specific binds (#13073)
Adds support for device-specific binds
Diffstat (limited to 'hyprtester/src/tests/main/keybinds.cpp')
| -rw-r--r-- | hyprtester/src/tests/main/keybinds.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/hyprtester/src/tests/main/keybinds.cpp b/hyprtester/src/tests/main/keybinds.cpp index a87a8b07..e01edd36 100644 --- a/hyprtester/src/tests/main/keybinds.cpp +++ b/hyprtester/src/tests/main/keybinds.cpp @@ -513,6 +513,34 @@ static void testSubmapUniversal() { EXPECT(getFromSocket("/keyword unbind SUPER,Y"), "ok"); } +static void testPerDeviceKeybind() { + NLog::log("{}Testing per-device binds", Colors::GREEN); + + // Inclusive + EXPECT(checkFlag(), false); + EXPECT(getFromSocket("/keyword bindk SUPER,Y,test-keyboard-1,exec,touch " + flagFile), "ok"); + OK(getFromSocket("/dispatch plugin:test:keybind 1,7,29")); + EXPECT(attemptCheckFlag(20, 50), true); + OK(getFromSocket("/dispatch plugin:test:keybind 0,0,29")); + EXPECT(getFromSocket("/keyword unbind SUPER,Y"), "ok"); + + // Exclusive + EXPECT(checkFlag(), false); + EXPECT(getFromSocket("/keyword bindk SUPER,Y,!test-keyboard-1,exec,touch " + flagFile), "ok"); + OK(getFromSocket("/dispatch plugin:test:keybind 1,7,29")); + EXPECT(attemptCheckFlag(20, 50), false); + OK(getFromSocket("/dispatch plugin:test:keybind 0,0,29")); + EXPECT(getFromSocket("/keyword unbind SUPER,Y"), "ok"); + + // With description + EXPECT(checkFlag(), false); + EXPECT(getFromSocket("/keyword binddk SUPER,Y,test-keyboard-1,test description,exec,touch " + flagFile), "ok"); + OK(getFromSocket("/dispatch plugin:test:keybind 1,7,29")); + EXPECT(attemptCheckFlag(20, 50), true); + OK(getFromSocket("/dispatch plugin:test:keybind 0,0,29")); + EXPECT(getFromSocket("/keyword unbind SUPER,Y"), "ok"); +} + static bool test() { NLog::log("{}Testing keybinds", Colors::GREEN); @@ -537,6 +565,7 @@ static bool test() { testSubmap(); testSubmapUniversal(); testBindsAfterScroll(); + testPerDeviceKeybind(); clearFlag(); return !ret; |
