How do I stop the switch from looping when I hold it down?

I need some code that when a keyboard letter is held down it will only be pressed 2 times until I release it and not loop like it normally would.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum