According to this example, you can use interrupts in order to detect button press.
How, i can use interrupt (how to set a callback function) to be triggered when i release the button (not by polling the button value)?
Peripheral lbs example does this somehow, but it's too complicated compared to the button example.