ok, to put a key into the keyboard buffer without the user actually pressing the button you will need to know the scan code of the key and the character of the key. this uses interrupt 15 sub function DE10h. ok they way i did it was
TYPE RegType
AX AS INTEGER
BX AS INTEGER
CX AS INTEGER
DX AS INTEGER
BP AS INTEGER
SI AS INTEGER
DI AS INTEGER
FLAGS AS INTEGER
DS AS INTEGER
ES AS INTEGER
END TYPE
DIM SHARED Regs AS RegType
SUB writekeytobuffer (scancode,char)
Regs.AX=&HDE10
Regs.BH=scancode
Regs.BL=char
CALL INTERRUPT(&H15,Regs,Regs)
END SUB
[\b][\color blue]
if you want to know the exact specifications of the subfunction of the interrupt i used they are
NT 15 - DESQview v2.00+ - "PUSHKEY" - PUT KEY INTO KEYBOARD INPUT STREAM
AX = DE10h
BH = scan code
BL = character
Return: nothing
Notes: a later read will get the keystroke as if it had been typed by the user
multiple pushes are read last-in first-out
if a script exists for the pushed key in the current application, the
script will be executed
early copies of DV 2.00 destroy AX, BX, ES, and DI
SeeAlso: INT 16/AH=05h
I got that from ralph browns interrupt list