Maybe you can describe your setup more thoroughly? Are you using the laptops keyboard and external mouse? Is the mouse wireless? etc etc.
I believe it when you say you aren't hitting by accident. But using a mouse doesn't prevent you from accidently hitting the touchpad -- if your typing with the laptop's keyboard. The touchpad will still be accepting input unless you've configured it to be disabled while using a mouse. (See synamptic's settings to enable that.) To be sure, simply try disabling the touchpad via the laptop's function button combination. (Much like the process if you wanted to disable wireless. Fn + ?)
However, given you can't type, it sounds like the window is losing focus. When you change between windows, the upper-most bar where settings like File... are located, will change colors between active and inactive. Can you comment if there is a change in color between when it is working and not? You can try pressing ALT once then using the left and right arrow keys to get an barring on what is being focused on when you can't type. Make sure you have a few files or shortcuts on your desktop and the on-screen keyboard open. This will help indicate if nothing is being focused on or if no input is registered, which then you can deduce it more as a bug, driver or connection issue.
Does it happen in all windows that have type functionality such as notepad and notepad++, browsers, and or powershell/CMD?