intHandle = AddKBInt(intRoutine, intData);
D0 A0 A1
APTR AddKBInt(APTR, APTR);
This routine extends the functionality of the keyboard interrupt to include intRoutine. Since this is an extention of the normal keyboard interrupt all of the keyboard handshaking is handled. The keyboard error codes are filtered out and not passed to intRoutine.
The routine is called whenever the user enters a key on the keyboard.
The routine is called from within an interrupt, so normal restrictions apply. The routine must preserve the following registers: A2, A3, A4, A7, D2-D7. Other registers are scratch, except for D0, which MUST BE SET TO 0 upon exit. On entry to the routine, A1 holds 'intData' and A5 holds 'intRoutine', and D0 contains the rawkey code read from the keyboard.
The routine is not called when a reset is received from the keyboard.
This is a low level function that does not fit the normal Amiga multitasking model. The interrupt installed will have no knowledge of which window/screen currently has input focus.
If your program is to exit without reboot, you MUST call
RemKBInt() before exiting.
Only one interrupt routine may be added to the system. ALWAYS check the return value in case some other task has previously used this function.