Added onKeyDown event listener and textUpdate method