Using KM to manage Keyboards and palette between Macs

I am using 2 Mac (a Mac Mini and a Macbook) with only one external keyboard.

Sometimes, I want to use my keyboard with only one and sometimes with the other one only. The problem is in order to achieve that it means, as far as I know, disconnect my keyboard from one Mac and connect it to the other Mac.

I was wondering whether KM could help. The logic of the two macros I would create would look something like:

At wake of "Mac 1", CHECK whether "Mac 2" bluetooth is available if yes connect, if not then show message "Mac 1 bluetooth not available".

At wake of "Mac 2", CHECK whether "Mac 1" bluetooth is available if yes connect, if not then show message "Mac 1 bluetooth not available".

I am obviously open to any other opinion of yours :grinning:

I also tried to use applications like Synergy, Teleport, Sharemouse but unfortunately I find them not reliable.