I have a SOHO setup where I use a USB keyboard and a USB mouse connected to my MacBook. The placement of the USB keyboard relative to my MacBook is as shown in the picture:
I primarily use the external USB keyboard for all my typing needs.
However, sometimes I need to type using the MacBook's built-in keyboard. Due to this particular arrangement, it's inconvenient to type without unintentionally pressing keys on the USB keyboard.
I find it a bit tedious to move the USB keyboard aside or unplug/plug the cable repeatedly during my workflow.
I am looking for a way to programmatically disconnect/reconnect the USB keyboard. Any hidden settings, scripts, Terminal commands are welcome.
I'd prefer not to install any 3rd party software, but wouldn't mind it either if no built-in solution exists.
I am running macOS Mojave 10.14.5, but looking for a generalized solution that works independent of the version of macOS (not a hard limitation, not targeting ancient versions).