You do not mention what type of hardware you are using which can be useful in figuring out the source of trouble.
For external keyboards such as USB connections are often the problem. Bluetooth can disconnect on its own as well. On detachables or two in one machines, it is often just “flakey” and sometimes disconnecting and reconnecting will straighten out the problem. If the machine is a laptop plugging in an external keyboard might provide a temporary work around.
From what I can tell the on screen keyboard used in Gnome and Endless and just generally Linux onscreen keyboards behave very erratically and are close to being useless.
If nothing above helps with your problem you can look through your system logs or post them so that others can look for the source of your problems. I assume since you posted to the forums you must have discovered some workaround to your problem.
bill