Well, I've finally worked out the major bits of it. After much
and
It turns out this is how it works.
1. A button is pressed on the panel. The 8279 then stores the value in FIFO encoded 2-key lockout.
Meaning the value is DB7 = Ctrl key, DB7 Shift key. DB5 is scan line 2, DB4 scan line 1, DB3 scan line 0 and DB2 to DB0 are the key value in an encoded format.
It means that in my case, the entire keyboard is in the range of C3 - F7 (converting binary to hexadecimal).
2. The main program loops round but continuously checks the FIFO ram. If there is something in memory it is read at address 0510. It then uses a lookup table at 075D.
So for example, F1 then becomes 2F at 07BE. 40 signifies that the feature is unavailable or not used.
3. I believe it then raises various software interrupts, but mainly RST 3 to perform another lookup based on the mapped value (e.g. 2F) to set the program counter and arrive at a specified address.
The table I uploaded before, as shown below is for validating and mapping GPIB commands (L0C59). The 1st Val column maps to the same values as the keyboard. So where the keyboard maps F1 to 2F. A command starting with the ASCII character 'Z' will map to the same value of 2F. From there it executes the same software interrupts and ends up at the same addresses.
The 2nd Value column in the table represents the type of value it can accept.
80 seems to be a three digit number.
00 is a two digit number.
Anything between 02 and 09 are single digit numbers.
01 is a value with a suffix. e.g. MV, V, KHZ, HZ.
What a learning curve!