Autocomplete text insertion

Text insertion now works under certain conditions, still buggy when last
key code was return, or other special character