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