mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-14 12:53:43 +01:00
skhd's modes, and sxhkd's chains that stay open, are sets of keys that are active together; a static shortcut cannot be in one. The engine already computes the keys a mode wants. What the daemon adds is that a mode switch reaches kglobalaccel as it should: the keys of the mode left are let go with setInactive, so that they reach the focused window again, and those of the mode entered are grabbed, bare keys included, before the next key arrives. It logs the mode after each change, which is the one way to see from outside which mode the engine is in. A unit test follows the calls of entering a mode and leaving it with Escape. The VM test vm-keys-engine grows a section with wev focused: in the default mode a bare H reaches wev; Alt+R enters the mode resize and runs its command, after which H runs its binding and does not reach wev; Escape goes back, and H reaches wev again. That turns "a key the engine does not want reaches the application" from a convention into a proved rule.