When using --toggle, you can choose between two modes of operation via the mode= clause. This determines how the toggle behaves if the active target changes while a key is being held down.
mode=passive
In passive mode, every source event is mapped to the currently active target event at the exact moment the event occurs.
Warning: This can lead to "stuck" keys. For example, if you press A (mapping to B), then change the toggle target to C before releasing A, the release event for A will be mapped to C. This leaves the B key in a permanent key_down state because its corresponding key_up event was never sent.
mode=consistent (Default)
Consistent mode prevents stuck keys by tracking the state of individual keys. For every key, the toggle remembers which target was active when the key_down event was received. It will then map all subsequent events for that specific key (like key_up) to that same target, even if the global active target for the toggle changes in the meantime.