Button event
Returns the ID of one of these button event types:
- Pressed Down (1)
- Released Up (2)
- Clicked (3)
- Long clicked (4)
- Hold (5)
This block can be used to define the event type in on button event and on pin event.
Note, that by pressing a Button multiple events can raise at the same moment:
| # | User input | Event raised |
|---|---|---|
| 1 | Press A down | A.Down |
| 2 | Hold A for > 1.5 seconds | A.Hold |
| 3 | release A | A.Up |
| A.LongClick |
| # | User input | Event raised |
|---|---|---|
| 1 | Press A down | A.Down |
| 2 | Press B down | B.Down |
| 3 | A+B.Down | |
| Release A up | A.Up | |
| A+B.Up | ||
| A+B.Click | ||
| Release B up | B.Up |
- Every Up-Event will always be followed by either a Click- OR Long-Click-Event, depending on how long the Down-Event has been ago.
Pressed Down
- For button
AorB: This handler works when the button is pushed down. - For
AandBtogether: This handler works whenAandBare both pushed down, at the moment the second button is pressed.
Released Up
- For button
AorB: This handler works when the button is released up. - For
AandBtogether: This handler works at the moment the first button is released up whileAandBare both pushed down.
Clicked
- For button
AorB: This handler works when the button is pushed down and released within 1 second. - For
AandBtogether: This handler works whenAandBare both pushed down, then one of them is released within 1.5 seconds of pushing down the second button.
Long clicked
- For button
AorB: This handler works when the button is pushed down and released after more than 1 second. - For
AandBtogether: This handler works whenAandBare both pushed down, then one of them is released after more than 1.5 seconds after pushing down the second button.
Hold
- For button
AorB: This handler works when the button is pushed down and hold for 1 second. - For
AandBtogether: This handler works whenAandBare both pushed down and hold for 1.5 seconds after pushing down the second button.
This is an advanced API. For more information, see the Calliope mini runtime messageBus documentation.