Fields
2 fields, each with what it does.
Fields| Field | Type | Default | What it does |
|---|
longPressActionlongPressAction | action | — | What happens when you hold Runs this action when the control is held down, with no popup. |
|---|
longPressGrouplongPressGroup | object | — | A pop-up menu on hold Opens a frosted popup of child controls from the control when it is held down. |
|---|
Examples
3 examples, each one a control you can paste into a layout.
Demonstrates longPressGroup: holding the button opens a frosted two-button popup.
JSON 11 lines
{
"type": "button", "id": "lights", "position": [0, 0], "label": "Lights",
"longPressGroup": {
"id": "lights-menu", "label": "Lights",
"grid": { "columns": 2, "rows": 1 },
"children": [
{ "type": "button", "id": "all-on", "position": [0, 0], "label": "All on" },
{ "type": "button", "id": "all-off", "position": [1, 0], "label": "All off" }
]
}
}
Open in CAR-TER ↗
Demonstrates longPressAction: holding runs the action directly, with no popup.
JSON 17 lines
{
"type": "button",
"id": "panic",
"position": [
0,
0
],
"label": "Alarm",
"longPressAction": {
"method": "meshsocket",
"mode": "broadcast",
"event": "broadcast_request",
"payload": {
"msg_type": "alarm"
}
}
}
Open in CAR-TER ↗
Demonstrates longPressAction on a non-button host: the toggle flips on tap and the hold runs a separate action.
JSON 17 lines
{
"type": "toggle",
"id": "fan",
"position": [
0,
0
],
"label": "Fan",
"longPressAction": {
"method": "meshsocket",
"mode": "broadcast",
"event": "broadcast_request",
"payload": {
"msg_type": "fan_boost"
}
}
}
Open in CAR-TER ↗
Sub-Group
"longPressGroup": {
"id": "menu",
"label": "Quick Actions",
"grid": { "columns": 3, "rows": 2 },
"children": [ ... ]
}
Features
- Frosted blur background
- Bouncy spring from source
- Dismiss: tap outside / swipe down
- Haptics: medium on open
Action Only
"longPressAction": { ... }
Fires without popup. See Toggle expand.
Generated from ControlDocs/long-press.md. Something unclear or missing? Tell me.