How to use push button to input value

I think you meant detect when the button becomes pressed rather than is pressed and similarly for the release