05.02.2016, 17:56
Depends on how your button is configured. Most physical button inputs have rising (on) and falling (off) edge detection. You can set a fixed value to both actions, so in your script you can use event.getvalue() to figure out if button is pressed or released.