Hello and welcome to Android Central Forums...
Have you tried opening it up in safe mode..??.because sometimes some 3rd party apps arise issues with the proper functioning of the device...try booting your device in safe mode....and look for any apps that might be causing this issue..also if you have installed any 3rd party keyboard app..try removing it...if its working fine after that then well and good...else there might be issues with the Android Operating system or hardware of the device...try formatting the device....
I believe workaround in the safemode would solve your issue...let me know...
Regards..