Turning off a host makes diverted host change keys unusable
Created by: jeblad
Information
If a Host Switch Channel on a device (keyboard) is diverted to local rule handling on a host that goes dead, typically by turning it off, then the device can't be switched to another host. The diverted state stays, it is set in the device, while the rule that should handle the keypress goes away, as it is done in the now dead host.
MX Keys detects the current host goes offline and switches to the first host that is online. The MX Anywhere are not able to handle the situation and just hangs on the dead host. A previous keyboard had an awfully long timeout when the host went dead. Haven't tested MX Mech mini, as I have only one Bolt dongle. I believe the M590 mouse switched after a rather short timeout.
Somehow the troublesome diverted key should be reset at shutdown. That to could be cumbersome as it is not given that solaar is still running. A simple solution could be to have a "shutdown" conditional that is triggered by a signal (i.e. SIGTERM). As signals are often abused it is not a given that this gives a good or even workable solution.
In this particular case it is not critical to me, because the MX Anywhere mouse has accessible buttons underneath to manually switch the host.