Is there a way to register only one key press?

Currently i have a variable being added when you click the right key or being subtracted when you click the left key, and whilst it does work. Depending on how long you hold the key it will register add much more than the desired number.

I can try and tap the key it still sometimes doesn’t work. Any help would be greatly appreciated. Thanks