Gps toggle on 4 clicks

This commit is contained in:
Florent de Lamotte 2025-06-18 11:52:16 +02:00
parent b3184eb94c
commit 8765b3d040
8 changed files with 28 additions and 2 deletions

View file

@ -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;