The majority of rapid trigger keyboards use Hall Effect (magnetic) switches for this, which use a magnet to detect the distance between the key and the PCB beneath, while analogue optical switches ...