Attempt to make modifier key changes take affect when the dialogue closes. This means you don't have to restart Fenrir to apply them.

This commit is contained in:
Storm Dragon committed 2026-10-29 18:27:20 -04:00
1 parent 15e04aa8f8
commit 22f6df6af9
23 files changed
+454 -58

No files matched your search

+17
View File
@@ -94,3 +94,20 @@ func TestCapsLockScriptModifierKeepsShiftToggle(t *testing.T) {
t.Fatal("script chord toggled capitalization", got)
}
}
func TestModifierReconfigurationPreservesInstalledScriptBindings(t *testing.T) {
r := desktop_router(t)
if err := r.Configure_modifiers([]string{"KEY_INSERT"}, []string{"KEY_COMPOSE"}); err != nil {
t.Fatal(err)
}
if err := r.Configure_scripts([]string{"KEY_COMPOSE"}, []ScriptBinding{{ID: "script:example", Keys: []string{"KEY_SCRIPT", "KEY_U"}}}); err != nil {
t.Fatal(err)
}
if err := r.Configure_modifiers([]string{"KEY_META"}, []string{"KEY_CAPSLOCK"}); err != nil {
t.Fatal(err)
}
r.Key(0, KeyCapsLock, 1, false, false)
if got := r.Key(0, 22, 1, false, false); got.Command != "script:example" {
t.Fatal("script binding lost", got)
}
}