Regarding the key matrix, Apple used the off the shelf MOS MM5740 AAE, which was designed to work with or mimic a Teletype ASR 33 type keyboard : at page 99 you can see the keymapping. Although custom decoding could be ordered for the MOS MM5740, I don't expect Apple would have wanted to pay for it.