Hello,
You can use barrier to share mouse/keyboard between your two machines. Free software and works very well. It is not native M1 but I had no problems running it. Just install on each machine, set one as server (the one with the keyboard and mouse), other as client, and you are in business.
GitHub - debauchee/barrier: Open-source KVM software
Open-source KVM software. Contribute to debauchee/barrier development by creating an account on GitHub.github.com
Great, will check it out