mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Gps toggle on 4 clicks
This commit is contained in:
parent
b3184eb94c
commit
8765b3d040
8 changed files with 28 additions and 2 deletions
|
|
@ -50,9 +50,12 @@ void Button::update() {
|
|||
triggerEvent(SHORT_PRESS);
|
||||
} else if (_clickCount == 2) {
|
||||
triggerEvent(DOUBLE_PRESS);
|
||||
} else if (_clickCount >= 3) {
|
||||
} else if (_clickCount == 3) {
|
||||
triggerEvent(TRIPLE_PRESS);
|
||||
} else if (_clickCount >= 4) {
|
||||
triggerEvent(QUADRUPLE_PRESS);
|
||||
}
|
||||
|
||||
_clickCount = 0;
|
||||
_state = IDLE;
|
||||
}
|
||||
|
|
@ -116,6 +119,9 @@ void Button::triggerEvent(EventType event) {
|
|||
case TRIPLE_PRESS:
|
||||
if (_onTriplePress) _onTriplePress();
|
||||
break;
|
||||
case QUADRUPLE_PRESS:
|
||||
if (_onQuadruplePress) _onQuadruplePress();
|
||||
break;
|
||||
case LONG_PRESS:
|
||||
if (_onLongPress) _onLongPress();
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue