How can I execute some code 1 time when space bar is pressed and keeps being pressed in java
<p>I've been working on my game and now, my player needs to shoot. He does shoot but to decrease the ammo, it keeps decreasing as long as I hold the space bar. I'd like to know a code that lets me remove -1 ammo each time the spacebar is pressed and even if it's still pressed. Thanks, hope you answer me soon!</p>
