The replacement switch is electrically noisy and a single press sometimes becomes two menu selections. Hardware repair is planned, but I want the menu code to behave too.
Is one clean-then-release state enough, or do you also wait a few frames?
Debouncing a joystick fire button in software
3 replies · opened JUL 31 ago
For menus I require release before accepting another press. It feels natural and avoids guessing at a delay.
Sample once per frame and track the transition, not the held state. A short stability count can help truly bad switches.
Fix the switch anyway. Code can make a tired button polite, not healthy.
Want to add to this transmission?
SIGN IN TO REPLY →