Home |
RTTarget-32 Programming Manual Function RTSetKeyboardTables Function RTSetCodepageTranslation Function RTInsertKeyboardScanCode System Management BIOS (SMBIOS) Advanced Programmable Interrupt Controller (APIC) |
Function RTSetKeyboardTablesRTTarget-32's keyboard driver is preconfigured to support US, German, French, Spanish, Italian, and Portuguese keyboard layouts using the OEM code page 437. Function RTSetKeyboardTables is used to install and activate custom translation tables for the keyboard driver: typedef const struct { // generic translator, first entry: {0, #Entries} WORD Key; // must be sorted on Key WORD Value; } RTKeyTable; typedef const struct { // lookup tables for keyboard driver int BasedOn; // based on language index BasedOn DWORD Flags; RTKeyTable * SCToVK; // scan code -> virtual key code RTKeyTable * VKToLower; // virtual key code -> Unicode character RTKeyTable * VKToUpper; // virtual key code -> character (upper) RTKeyTable * AltCar; // virtual key code -> character (AltCar) } RTKeyLanguage; RTKeyLanguage * RTSetKeyboardTables(int Index, RTKeyLanguage * Table); ParametersIndexParameter Index may be in the range 0 .. 15. Indices 0 .. 7 are reserved for US, German, French, Spanish, Italian, and Portuguese, respectively, and for future extensions. They should not be used (but may be used to remove and override a predefined language). It is recommended to install custom keyboard mappings on higher indices such as 15 or 11. TablePointer to a structure describing the desired keyboard layout. return valuePointer to the RTKeyLanguage structure previously installed on the given index, possibly NULL. Variable size arrays of type RTKeyTable are used as generic translation tables. The first entry's Value member must have the number of following value pairs. The table must be sorted on member Key. Type RTKeyLanguage contains all lookup tables the keyboard driver needs to map keyboard scan codes supplied by the keyboard controller to character values. Member BasedOn specifies which other keyboard table should be used if no translation for a particular value is found. BasedOn implements a linked list of RTKeyLanguage structures of up to 16 entries. Value -1 specifies that no other tables should be scanned. Member Flags can specify additional properties of the keyboard behavior. Any combination of these flags is supported:
Table ScToVK is used to map device scan codes to Win32 virtual key codes. Standard virtual key codes are declared in winuser.h. If you need to define custom virtual key codes, use values in the range 0x0100 .. 0xFFFE. Table VKToLower maps virtual key codes to Unicode character values. Table VKToUpper maps virtual key codes to Unicode character values when shift is pressed. Table AltCar is used to translate virtual key codes when the right Alt key is being held down. To explicitly disable a key in a particular table, translate it to value 0xFFFF. Function RTSetKeyboardTables is used to install and activate the translation tables for the keyboard driver. After installation, different languages can be activated by calling RTSetFlags(Index << 8, 1); or by pressing Ctrl-Alt-Fx, where the x is Index+1. Function RTSetCodepageTranslation
|