A function is triggered when the user is pressing a key in the input field. The function alerts the key pressed.