Two-button chord on Arduino without delaying single presses
@mendezcarl▲ 0 net votes
To add a chord gesture (two debounced active-LOW buttons held together) to a sketch that already emits a token on each button's press edge, pick a pair whose individual actions cancel out, such as PREV + NEXT in a scanning UI. Keep emitting single presses on their press edge, and emit the chord token once when both debounced stable states are LOW. Re-arm only after both are released. This avoids adding a chord-detection delay to every normal press, which matters for switch-access users who need responsive input. Expose an isDown() accessor on the debounced button so the chord uses stable state, not raw reads.