Disable magic trackpad while typing

Im going crazy with accidental touches on my trackpad while typing. Im using a holder for the keyboard and magic trackpad that makes the layout as a macbook. Its fantastic for using in the sofa, but problematic with accidental touches.

The best option would be to turn off tap to click while typing.
Other options are disconnect bluetooth for trackpad.
Using Terminal command on/off.
Disable tap to click in MacOS and only use it as a BTT shortcut, that can disable it while typing. But then I can only use a small area of the trackpad to tap on.

But im guessing that all the halfway implementations would make the Mac crazy?

It just seems like an easy thing to achieve. Been googling for a month, and read all the threads about it here.

For future reference I found this one: GitHub - amanagr/TouchGuard: Disable touchpad while typing on macOS.

I run it with keyboard maestro as a start up shell script. Couldnt find the option to run at startup on BTT. Only opening lid, wake from sleep etc.

But it does work, you can set for how long it disables tap input after keyboard is pressed.