Mechanical key bounce likewise requires software debounce
Aliases: switch bounce · key debouncing · hardware double-fire
What it is
Metal contacts or a dome switch chatter on and off for milliseconds at make and break. A scope shows a burst of spikes; firmware that counts every edge turns one press into several keycodes. That is switch bounce. Like a pad reseating on glass, it is one intent and several electrical events, but the source is the switch, not skin. Volume, power, a physical confirm next to a capacitive panel, and external keyboards all need debounce in software or firmware. The mechanics will not come clean in one motion.
Why it happens
Contact surfaces are microscopically uneven; they bounce, creep, and remake, usually shorter and denser than skin rebound. Hardware can add an RC filter; most consumer devices still leave a clean edge to the MCU: after the first make, ignore further edges inside a window, then sample once at the end to confirm. Too short a window, and spikes leak through as doubled characters, double shutter, or airplane mode flicked twice. Too long, and the key feels sticky. Power also has a long-press-to-off; the debounce window must sit below that threshold, or a short press is dragged into a dubious long-press candidate. Touch-button debounce and mechanical debounce must not share a timer: the chatter timescales and the things they mis-kill differ.
Studying it
Scope make/break chatter width and count, timestamp keycodes in firmware, and compare debounce on versus off. Independent variables are press force, key age (new versus worn), temperature, and window length. Dependent measures are keycodes per intended press, fraction of short presses promoted to long-press, and whether two different keys in a row are wounded by the same window. Write methods for touch bounce and mechanical debounce separately: one needs high-speed skin video, the other needs the electrical signal. Worn keys chatter wider; a window set on a new unit may fail at end of life.
Where it stops holding
Hall, optical, and capacitive power keys have no metal-contact bounce; their spikes are threshold jitter and want a different window. Mechanical-keyboard NKRO is about simultaneous key count, not bounce. Automotive switches have their own EMI and temperature spectra; a 5–20 ms consumer window does not transfer. An on-screen “key” has no mechanical bounce; applying switch debounce only dulls the virtual key.
Applying it
- Give volume, power, and shutter their own firmware debounce window, and accept with a scope plus keycode log that one press is one code.
- Keep the debounce ceiling below the long-press threshold so a short press cannot be dragged into the long-press machine.
- Retest on aged units and high-temperature units; a window that only passes on a new room-temperature key is not a pass.
Related
- Same group: C2.22.1 Bounce clicks are rapid extra triggers from contact rebound, not intent · C2.22.2 Repeat-trigger intervals trade responsiveness against debounce · C2.22.3 Overlong debounce blocks intentional rapid taps
- Nearby: C10.08 Key travel, tactile detent, and confirmation · C6.02 Key travel and tactile confirmation
- Search terms:
switch bounce·debouncing·mechanical key