Well, below is a snippet from Daryl's code explaining the routines that are available for external calls:
;********************************************************************************************
; Software communicates to/from the keyboard and converts the received scan-codes
; into usable ASCII code. ASCII codes 01-7F are decoded as well as extra
; pseudo-codes in order to acess all the extra keys including cursor, num pad, function,
; and 3 windows 98 keys. It was tested on two inexpensive keyboards with no errors.
; Just in case, though, I've coded the <Ctrl>-<Print Screen> key combination to perform
; a keyboard re-initialization just in case it goes south during data entry.
;
; Recommended Routines callable from external programs
;
; KBINPUT - wait for a key press and return with its assigned ASCII code in A.
; KBGET - wait for a key press and return with its unprocessed scancode in A.
; KBSCAN - Scan the keyboard for 105uS, returns 0 in A if no key pressed.
; Return ambiguous data in A if key is pressed. Use KBINPUT OR KBGET
; to get the key information. You can modify the code to automatically
; jump to either routine if your application needs it.
; KBINIT - Initialize the keyboard and associated variables and set the LEDs
;*******************************************************************************************
Based on the above, the routine that EhBasic should call could be something like this:
Code:
Input vector points here:
JSR KBSCAN ; Check to see if a key was pressed
BEQ NO_KEY ; If no key pressed, exit
JSR KBINPUT ; Get key pressed and process to ASCII
SEC ; Set carry flag to show a character is in A reg
RTS ; return to caller
NO_KEY
CLC ; ensure carry flag is clear showing no character
RTS ; return to caller