Keyboard Layout - peterw8102/Z80-Retro GitHub Wiki

The Omega MSX keyboard is a fairly simple matrix. There are 9 rows, each row contains 8 switches. The processor can read the state of all switches in one row by writing a row number (0-9) to bits 0-3 of port C4h (which is latched) and then reading the value of the 8 switches by reading from port C4h. The following tale shows the position of each of the keys for each row:

Row Col 7 Col 6 Col 5 Col 4 Col 3 Col 2 Col 1 Col 0
0 7 6 5 4 3 2 1 0
1 ; ] [ \ = - 9 8
2 b a MENU / . , ` '
3 j i h g f e d c
4 r q p o n m l k
5 z y x w v u t s
6 F3 F2 F1 FN1 LOCK OPT CTRL SHIFT
7 CR FN2 BS PGDN TAB ESC F5 F4
8 RIGHT DOWN UP LEFT DEL HOME PGUP SPC

Col n represents bit n in the value polled back from inout fort C4h.

A pressed key in this matrix is represented by a '0' in the relevant bit in the row value. If no keys are pressed in a polled row then 0xFF is returned.