The Keyboard class (KEYBOARD.CLS) allows you to set and retrieve information about the keyboard hardware. Obviously, many of the properties are read-only, but several allow you to control the settings used by the keyboard. Table 9.9 lists and describes all the properties of the Keyboard class. Figure 9.12 shows the properties supplied by the Keyboard class that have equivalents in the Windows user interface.
Table 9.9: Properties Supplied by the Keyboard Class
Property | Read/Write? | Description |
CapsLock | Yes | Returns or sets the CapsLock toggle |
CaretBlinkTime | Yes | Sets or retrieves the number of milliseconds between blinks of the caret. Allowable values: 200 to 1200 (in multiples of 100) |
CaretOn | No | Shows or hides the caret. Most apps control the caret themselves, and this call will have little or no effect except in limited circumstances |
Delay | Yes | Sets the keyboard repeat-delay setting. Only values 0 through 3 are acceptable |
FunctionKeys | No | Determines the number of function keys on the keyboard. The return value can be any of the values in Table 9.10 |
KeyboardType | No | Determines the type of keyboard on the system. The return value can be any of the values in Table 9.11 |
NumLock | Yes | Returns or sets the NumLock toggle |
ScrollLock | Yes | Returns or sets the ScrollLock toggle |
Speed | Yes | Sets the keyboard repeat-speed setting. Only values 0 through 31 are acceptable |