Finally! The mythical keyboard post!! Sorry it’s taken so long, but SokoBAArn was taking it’s time (along with a large & overgrown garden back in the real world). Anyway, we’re here now, woohoo!!
Back in the depths of time I did a short piece on how to detect if a key is pressed, which used the following code:
WAITFORKEY: ld a, 0 in a, (254) cpl and %00011111 jp z, WAITFORKEY
That’s actually the basis for all keyboard reading, and as complicated as it gets, just that we were doing a particular and simple case – testing for any key being pressed.