Display text once a key is press

need to know how to make an x appear everytime i press the x key and everytime i press it another one should appear and how to reset it help me please and thankyou