This is a re-use of the same algorithm. This time it translates a key press into a key value. Could be used for high score input which uses the keyboard to type in a name and not the easy scroll letters to get an input. The big wastage is the translate table. The purpose of typing this is only to show a quick re purposing of a routine. (Of note I have seen far worse than this)
IN A,( C )
JR C,keyloop1 << corrected
LD A,(HL) ;the key value from the keyboard
TABLE db 0,"ZXCVASDFGQWERT1234509876POIUY",13,"IJKL ",1,MNB"
TABLE db 0,"ZXCVASDFGQWERT1234509876POIUY",13,"LKJH ",1,"MNB" <<hopefully corrected
shift translates as 0, symbol shift as 1, enter as 13
Edited to correct the errors from my quick transcribe.
Edited by Norman Sword, 21 November 2018 - 01:02 PM.