Find out why first.
If the key actually is closing and opening three times you need to 'debounce' it. Most keypads suffer from contact bounce, it's caused by the mechanical switch contacts rebounding when they hit each other, the classic solution is to wait a short time after detecting the switch closure before checking it again. this process is called 'debouncing'.
The other possibility is that your software is simply reading the switch being closed repeatedly before it has time to open again. The solution to this is to read the keyboard again until it says no keys are pressed before continuing.
i think my software is simply reading the switch being closed repeatedly before it has time to open again. how i overcome this??