I do this virtually with a piece od software called barrier. https://github.com/debauchee/barrier
It's not clear from the page, but there's an issue somewhere that points out barrier has been abandoned for a fork called input-leap.
https://github.com/input-leap/input-leap
Also recently learned about waynergy as a upcoming wayland client. Haven't used either yet as barrier still handles my setup.