optical switches don't really use debouncing, it's more of a schmitt trigger where there are different voltage thresholds for key down and key up. As the optical gate closes, the voltage on the phototransistor lowers proportionally to the degree of closure So the only way to get a key down voltage level is to actually travel the switch to the down position, and likewise for key up.