OSBYTE &AC (172) - Read address of keyboard translation table
On entry: newvalue = (oldvalue AND Y) EOR X
On exit: YX=address of keyboard transation table. The top bits indicate if the MOS keyboard driver is being used or an alternative keyboard driver is being used.
- If Y=%11xxxxxx, MOS keyboard driver
- If Y=%10xxxxxx, sideways ROM keyboard driver
- If Y=%0xxxxxxx, International keyboard driver.
MOS keyboard driver
With the MOS keyboard driver, the address is the base of the internal keyboard table. The offsets into the table are the internal key numbers, being the negative INKEY number EOR 255, so 'Q' is key number &10, etc.
An entry of &00 is translated to the current TAB character set with OSBYTE 219. The entries for CAPSLOCK and SHIFTLOCK hold &01 and &02, but these are never used as the MOS checks for these two keys explicitly.
The MOS never uses the values returned by OSBYTE &AC and &AD, so changing them does not change the action of the MOS keyboard driver.
Sideways ROM keyboard driver
A keyboard driver in sideways ROM can use these two locations for its own use by setting OSBYTE &AD to %10xxxxxx.
International keyboard driver
With MOS 3.50 and MOS 5, if Y bit 7 is clear (implying a keyboard table in low memory), the MOS keyboard handler issues Service Call &30 to translate keypresses. With an International Keyboard Driver present:
- OSBYTE &AC holds the translated keypress on return from Service Call &30
- OSBYTE &AD holds the keyboard number in b5-b0, and returns the 'NULL needed' flag in b6.