For example when you press the space key something different happens and when you hold it down something different happens.
The rule is you only need one button for gameplay, so I'm pretty sure this is fine. I'm doing a game that does something when you press the button, then something else when you release the button.
It's fine indeed.