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

+19
View File
@@ -308,6 +308,25 @@ func (k *Keyboards) Close() error {
return errors.Join(errs...)
}
// Update_modifiers waits for every keyboard to release its old chord before
// replacing the router; the existing evdev grabs remain owned throughout.
func (k *Keyboards) Update_modifiers(fenrirKeys, scriptKeys []string) (bool, error) {
if k.router.Captured() || !k.router.Idle() {
return false, nil
}
for _, device := range k.devices {
if device.syncing || device.held() {
return false, nil
}
}
candidate := k.router
if err := candidate.Configure_modifiers(fenrirKeys, scriptKeys); err != nil {
return false, err
}
k.router = candidate
return true, nil
}
func (k *Keyboards) Poll(textMode, numLock bool, handle func(input.Decision)) error {
if !textMode {
for _, device := range k.devices {