'===========================================================================
' Subject: SET KEYBOARD RATE                  Date: Unknown Date (00:00)   
'  Author: Unknown Author(s)                  Code: QB, PDS                
'  Origin: SET,KEYBOARD,RATE                Packet: KEYBOARD.ABC
'===========================================================================
'$INCLUDE: 'qb.bi'

DECLARE SUB SetKBRate (InitDelay%, RepeatRate%)

SetKBRate 10, 250

SUB SetKBRate (InitDelay%, RepeatRate%) STATIC
'**********************************************************************
'* SUB SetKBRate
'*
'* PURPOSE
'*    Uses BIOS ISR 16H, Service 03H (Set Typematic Rate and Delay) to
'*    set the typematic rate of an AT keyboard.
'*
'* EXTERNAL ROUTINE(S)
'*    QBX.LIB
'*    -------
'*    SUB Interrupt (IntNum%, IRegs AS RegType, ORegs AS RegType)
'**********************************************************************

   DIM IRegs AS RegType, ORegs AS RegType

   IRegs.ax = &H305
   IRegs.bx = InitDelay% * 256 + RepeatRate%
   INTERRUPT &H16, IRegs, ORegs
END SUB

