You are going about it all wrong. Send ONE character when the key is pressed. Send another when the ley is released. Send a 'A' for the a key being pressed, and 'a' when it is released, for example.
Do NOT send a steady stream of characters while the key is held down.