Prev Next Home Home Table Of Contents Index



This program is used to control several keyboard functions. It is typically used in BATCH files. It can control the Caps Lock, Num Lock, and Scroll Lock keyboard functions. It can also lock and unlock the keyboard preventing users from interrupting programs. It can stuff up to 16 characters into the DOS keyboard buffer or clear the keyboard buffer. It can turn the Print Screen on and off.

 KBD commands are as follows:

CapsOn - Turns Caps Lock On. CapsOff - Turns Caps Lock Off. NumOn - Turns Num Lock On. NumOff - Turns Num Lock Off. ScrollOn - Turns Scroll Lock On. ScrollOff - Turns Scroll Lock Off. PrtScrOn - Turns Print Screen On. PrtScrOff - Turns Print Screen Off. Clear - Clears all Characters from the Keyboard Buffer. Lock - Locks the Keyboard. UnLock - Unlocks the Keyboard. Show - Shows Keyboard Codes that can be Stuffed. 0..31 - Sets Keyboard Repeat Rate. 0 = Fastest ,0..3 - Sets Keyboard Repeat Delay. 0 = Quickest * Default = 1.

Examples: KBD CapsOn NumOn ;Turns both the Caps Lock and Num Lock on. KBD Clear Lock ;Clears the buffer and locks the keyboard. KBD 6,1 ;sets repeat rate to 6 and delay to 1.

Stuffing the keyboard buffer is accomplished by putting strings in either single or double quotes. Putting a "^" in front of a letter sends the control character to the keyboard buffer. Putting a "$" in front sends the keyboard value (hexadecimal) to the buffer.

There are a few key words that stuff characters into the buffer.

   F1..F10, SF1..SF10, AF1..AF10, CF1..CF10
   Alt-A..Alt-Z, Alt-1..Alt-0, CR, ESC, TAB, LF, FF

Examples: KBD "Dir" CR ;Stuffs the buffer with the DIR command and a carriage return. KBD "Dir" ^M ;Same as above. KBD $3B00 ;Stuffs F1 key into the buffer

KBD ALT-X F1 6 NumOn "Free" CR PrtScrOff

This stuffs AltX, F1, "Free", and a carriage return in the keyboard buffer. It sets Num Lock to On and sets the keyboard repeat rate to 6, and disables the Print Screen key.

Prev Next Home Home Table Of Contents Index