Is there any way to bind two events at one button?

I want to use the st.BUTTON , when the button is pressed, to start running the code, and when I released the button,to stop running , Its mean that I want to bind two events at one click button motion,
How can I achieve this, or is there an another component could i use? Thanks a lot