add function to press key to each character of a string