Chapter 11
The KEYBOARD unit

The KeyBoard unit implements a keyboard access layer which is system independent. It can be used to poll the keyboard state and wait for certain events. Waiting for a keyboard event can be done with the GetKeyEvent (295) function, which will return a driver-dependent key event. This key event can be translated to a interpretable event by the TranslateKeyEvent (304) function. The result of this function can be used in the other event examining functions.

A custom keyboard driver can be installed using the SetKeyboardDriver (303) function. The current keyboard driver can be retrieved using the GetKeyboardDriver (295) function. The last section of this chapter demonstrates how to make a keyboard driver.


 11.1 Constants, Type and variables
   Constants
   Types
 11.2 Functions and Procedures
   DoneKeyboard
   FunctionKeyName
   GetKeyboardDriver
   GetKeyEvent
   GetKeyEventChar
   GetKeyEventCode
   GetKeyEventFlags
   GetKeyEventShiftState
   GetKeyEventUniCode
   InitKeyBoard
   IsFunctionKey
   KeyEventToString
   PollKeyEvent
   PollShiftStateEvent
   PutKeyEvent
   SetKeyboardDriver
   ShiftStateToString
   TranslateKeyEvent
   TranslateKeyEventUniCode
 11.3 Keyboard scan codes
 11.4 Writing a keyboard driver