I guess you'd record the curve of the first transition, and the after the debounce period has elapsed you'd use that curve to emit the appropriate key signal. Or alternatively you could use the whole analogue sequence as input for the key detection (assuming no limits on compute power etc). Neural net powered keystrokes!