This is an annoying issue that occurs randomly while typing on any laptop. The position of the cursor jumps to a random location while typing which makes typing a mess. This doesn’t mean the keyboard is faulty but on the other hand it is surprisingly related to touchpad and specifically to the Mouse Properties!
There are fortunately several ways to fix this problem. The easiest solution would be by installing an app called TouchFreeze(which I have not yet tried). Another way would be by just changing the Mouse Properties.
Launch Mouse Properties and goto Pointer Options. Uncheck “Hide pointer while typing” option and you are all set! For some reason if this issue persists goto touchpad settings of your respective laptop and check “Disable ELAN pointing device when external pointing device is plugged in” and use a mouse. Or you can just install TouchFreeze if this is too complicated.