Add event listener for keypress events