Disassembling the keyboard confirmed these findings – inside was a 455 kHz clock, with the keyboard sending a signal every 24 ticks producing the 18.960 kHz output. Reworking the initial code ...