We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ca3680 commit afb5d9dCopy full SHA for afb5d9d
1 file changed
src/LatchingButton.cpp
@@ -59,15 +59,20 @@ BUTTONSTATUS LatchingButton::getStatus()
59
switch (update())
60
{
61
case WASPRESSED:
62
+ {
63
// Capture the event of the button press. Some classes may require this to act on it.
64
return WASPRESSED;
65
+ }
66
67
case WASSHORTPRESSED:
68
69
// Toggle state.
70
_latched = !_latched;
71
return WASSHORTPRESSED;
72
73
74
case WASLONGPRESSED:
75
76
if (_resetOnLongPress)
77
78
reset();
@@ -77,12 +82,15 @@ BUTTONSTATUS LatchingButton::getStatus()
82
83
}
79
84
return WASLONGPRESSED;
85
80
86
81
87
case ISPRESSED:
88
case NOTPRESSED:
89
default:
90
91
// Nothing happened so we return based on the state.
92
return convertStateToButtonStatus();
93
94
95
96
0 commit comments