Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / All-Topics

USBkey: keyboard remapping from cmd line (ITC only)

0.00/5 (No votes)
4 Jan 2010CPOL3 min read 12K  
Remap usb keyboard of ITC devices

This is a simple keyboard remapper command line tool for devices having a USB keypad (CN3, CK61, CV30, CK3).

The ITC devices use a USB keyboard driver. You can remap keys of the keypad using the keby remapper tool from the Device Resource Kit. Unfortunately not all possible assignments are available with this remapper tool, so I wrote a tool that gives you full control. Be careful when using.

Usage

No args no work:

usbkey restore 0

Restore keytable shiftplane numbered 0

i.e. a CK3 numPad has 3 shiftplanes (0 to 2), with this command you can restore the original layout of a shiftplane.

usbkey dump

This will dump the actual shiftplanes into a file: \usbkey.txt.

usbkey setNOOP 0 "Left gui"

This will set the NOOP flag for the matching PS/2 key “Left Gui”, which is the windows key. This disables the Windows key. PS2 keynames here are not case sensitive.

usbkey setNOOP 0 "1"

This will disable (NOOP = No Operation) of the 1 key in plane 0.

usbkey resetNOOP 0 "Left GUI"

This will restore (unset) the NOOP flag for key “Left GUI” in plane 0.

usbkey setPS2key 0 "1" "2"

setPS2key iPlane szOldKey szNewKey
will change key assigned to ‘1' to produce a ‘2'

You can use the usb hex code of a key to specify the OldKey. You have to prefix the hex code by SCX (not case sensitive). In example:

usbkey setPS2key 1 scx0x1E F1

will set the key with usb scancode 0×1e in plane 1 to produce a F1

Since version 1.1, usbkey supports remapping of keys to point to ModifiersKeys:

To map F3 to the Caps modifier key, use this:

usbkey setKey2Mod 0 "F3" "Caps"

To map F4 to the Alt modifier key, use this:

usbkey setKey2Mod 0 "F4" "Alt"

The output of dump has been extended to show ModifiersKeys and Keys, that are not mapped to a PS2 key now are listed with the pointer. In example:

iUSBkey[30] hex: 0x0C,0xE9,0x00,0x02,0x01,0x01	
	CodePage:0x0C, ScanCode:0xE9, 'SHIFTKEY INDEX->1'

says: key with USB scancode 0xE9 is mapped as ShiftKey (don't see this as Shifted Key, ‘ShiftKey’ is used here as indicator for keys that change the shift plane).

General

Quotes are only needed around arguments containing spaces.
SCX syntax to specify key to change using USB code in hex can be used for setNoop, ResetNoop, SetKey2Mod and setPS2key. To get a list of available USB scan codes, use the dump command argument: ‘usbkey dump’. The second byte is the USB scanCode to use.

In example:

iUSBkey[8] hex: 0x07,0x22,0x00,0x00,0x00,0x2E    ... 'keyName='5'
                       ^
                       This is the entry for USB scancode: 0x22
                       The PS2 code created here is 0x2E,

                       which will produce '5'

If you specify one of the implicit VKEY values (F13 to F24) as newKey, you must specify the correct spelled name. Example: ’setPS2key 0 scX0×1e F13' – the F13 will be looked up in aPS2 table which says, this is a VKEY and then the tool will look in the VKEY table and look for ‘VK_F13' to get the scancode.

Remarks

USBkey uses a table to search against a given keyname string. This search is using the number of characters specified and is not case sensitive actually. This means, if you specify only “Left” as keyname, the tool will use the first found ‘left’ from a table, this may result in finding the entry for ‘Left Arrow’ or ‘Left GUI’ or anything else that I have in my keyname table starting with ‘left’. Here is the actual keyname table (PS2).

//UNASSIGNED replaced by 0xffff
//RESERVED   replaced by 0xAAAA
//NONE       replaced by 0xFFFE
//UNDEFINED  replaced by 0xFFFD
//vkey = 0xFFFA
//extended is 0xE0__

//"Key Name"	, HID Usage Page	, HID Usage ID	, PS/2 Set
usbPageUsageID usbPageUsageIDs[] = {
    {L"System Power", 0x01, 0x81, 0xE037},
    {L"System Sleep", 0x01, 0x82, 0xE03F},
    {L"System Wake", 0x01, 0x83, 0xE05E},
    {L"No Event", 0x07, 0x00, 0xFFFE},
    {L"Overrun Error", 0x07, 0x01, 0x00},
    {L"POST Fail", 0x07, 0x02, 0xFC},
    {L"Error Undefined", 0x07, 0x03, 0xFFFF},
    {L"a A", 0x07, 0x04, 0x1C},
    {L"b B", 0x07, 0x05, 0x32},
    {L"c C", 0x07, 0x06, 0x21},
    {L"d D", 0x07, 0x07, 0x23},
    {L"e E", 0x07, 0x08, 0x24},
    {L"f F", 0x07, 0x09, 0x2B},
    {L"g G", 0x07, 0x0A, 0x34},
    {L"h H", 0x07, 0x0B, 0x33},
    {L"i I", 0x07, 0x0C, 0x43},
    {L"j J", 0x07, 0x0D, 0x3B},
    {L"k K", 0x07, 0x0E, 0x42},
    {L"l L", 0x07, 0x0F, 0x4B},
    {L"m M", 0x07, 0x10, 0x3A},
    {L"n N", 0x07, 0x11, 0x31},
    {L"o O", 0x07, 0x12, 0x44},
    {L"p P", 0x07, 0x13, 0x4D},
    {L"q Q", 0x07, 0x14, 0x15},
    {L"r R", 0x07, 0x15, 0x2D},
    {L"s S", 0x07, 0x16, 0x1B},
    {L"t T", 0x07, 0x17, 0x2C},
    {L"u U", 0x07, 0x18, 0x3C},
    {L"v V", 0x07, 0x19, 0x2A},
    {L"w W", 0x07, 0x1A, 0x1D},
    {L"x X", 0x07, 0x1B, 0x22},
    {L"y Y", 0x07, 0x1C, 0x35},
    {L"z Z", 0x07, 0x1D, 0x1A},
    {L"1 !", 0x07, 0x1E, 0x16},
    {L"2 @", 0x07, 0x1F, 0x1E},
    {L"3 #", 0x07, 0x20, 0x26},
    {L"4 $", 0x07, 0x21, 0x25},
    {L"5 %%", 0x07, 0x22, 0x2E},
    {L"6 ^", 0x07, 0x23, 0x36},
    {L"7 &", 0x07, 0x24, 0x3D},
    {L"8 *", 0x07, 0x25, 0x3E},
    {L"9 (", 0x07, 0x26, 0x46},
    {L"0 )", 0x07, 0x27, 0x45},
    {L"Return", 0x07, 0x28, 0x5A},
    {L"Escape", 0x07, 0x29, 0x76},
    {L"Backspace", 0x07, 0x2A, 0x66},
    {L"Tab", 0x07, 0x2B, 0x0D},
    {L"Space", 0x07, 0x2C, 0x29},
    {L"-_", 0x07, 0x2D, 0x4E},
    {L"= +", 0x07, 0x2E, 0x55},
    {L"[ {L", 0x07, 0x2F, 0x54},
    {L"] }", 0x07, 0x30, 0x5B},
    {L"\\ |", 0x07, 0x31, 0x5D},
    {L"Europe 1", 0x07, 0x32, 0x5D},
    {L"; :", 0x07, 0x33, 0x4C},
    {L"‘ \"", 0x07, 0x34, 0x52},
    {L"` ~", 0x07, 0x35, 0x0E},
    {L", <", 0x07, 0x36, 0x41},
    {L". >", 0x07, 0x37, 0x49},
    {L"/ ?", 0x07, 0x38, 0x4A},
    {L"Caps Lock", 0x07, 0x39, 0x58},
    {L"F1", 0x07, 0x3A, 0x05},
    {L"F2", 0x07, 0x3B, 0x06},
    {L"F3", 0x07, 0x3C, 0x04},
    {L"F4", 0x07, 0x3D, 0x0C},
    {L"F5", 0x07, 0x3E, 0x03},
    {L"F6", 0x07, 0x3F, 0x0B},
    {L"F7", 0x07, 0x40, 0x83},
    {L"F8", 0x07, 0x41, 0x0A},
    {L"F9", 0x07, 0x42, 0x01},
    {L"F10", 0x07, 0x43, 0x09},
    {L"F11", 0x07, 0x44, 0x78},
    {L"F12", 0x07, 0x45, 0x07},
    {L"Print Screen", 0x07, 0x46, 0xE07C},
    {L"Scroll Lock", 0x07, 0x47, 0x7E},
    {L"Break", 0x07, 0x48, 0xE07E},
    {L"Pause", 0x07, 0x48, 0xfffD},
    {L"Insert", 0x07, 0x49, 0xE070},
    {L"Home", 0x07, 0x4A, 0xE06C},
    {L"Page Up", 0x07, 0x4B, 0xE07D},
    {L"Delete", 0x07, 0x4C, 0xE071},
    {L"End", 0x07, 0x4D, 0xE069},
    {L"Page Down", 0x07, 0x4E, 0xE07A},
    {L"Right Arrow", 0x07, 0x4F, 0xE074},
    {L"Left Arrow", 0x07, 0x50, 0xE06B},
    {L"Down Arrow", 0x07, 0x51, 0xE072},
    {L"Up Arrow", 0x07, 0x52, 0xE075},
    {L"Num Lock", 0x07, 0x53, 0x77},
    {L"Keypad /", 0x07, 0x54, 0xE04A},
    {L"Keypad *", 0x07, 0x55, 0xE07C},
    {L"Keypad -", 0x07, 0x56, 0xE07B},
    {L"Keypad +", 0x07, 0x57, 0x79},
    {L"Keypad Enter", 0x07, 0x58, 0xE05A},
    {L"Keypad 1", 0x07, 0x59, 0x69},
    {L"Keypad 2", 0x07, 0x5A, 0x72},
    {L"Keypad 3", 0x07, 0x5B, 0x7A},
    {L"Keypad 4", 0x07, 0x5C, 0x79},
    {L"Keypad 5", 0x07, 0x5D, 0x73},
    {L"Keypad 6", 0x07, 0x5E, 0x74},
    {L"Keypad 7", 0x07, 0x5F, 0x6C},
    {L"Keypad 8", 0x07, 0x60, 0x75},
    {L"Keypad 9", 0x07, 0x61, 0x7D},
    {L"Keypad 0", 0x07, 0x62, 0x70},
    {L"Keypad .", 0x07, 0x63, 0x71},
    {L"Europe 2", 0x07, 0x64, 0x61},
    {L"App", 0x07, 0x65, 0xE02F},
    {L"Keyboard Power", 0x07, 0x66, 0xE037},
    {L"Keypad =", 0x07, 0x67, 0x0F},
    {L"F13", 0x07, 0x68, 0xFFFA},
    {L"F14", 0x07, 0x69, 0xFFFA},
    {L"F15", 0x07, 0x6A, 0xFFFA},
    {L"F16", 0x07, 0x6B, 0xFFFA},
    {L"F17", 0x07, 0x6C, 0xFFFA},
    {L"F18", 0x07, 0x6D, 0xFFFA},
    {L"F19", 0x07, 0x6E, 0xFFFA},
    {L"F20", 0x07, 0x6F, 0xFFFA},
    {L"F21", 0x07, 0x70, 0xFFFA},
    {L"F22", 0x07, 0x71, 0xFFFA},
    {L"F23", 0x07, 0x72, 0xFFFA},
    {L"F24", 0x07, 0x73, 0xFFFA},
    {L"Keyboard Execute", 0x07, 0x74, 0xFFFF},
    {L"Keyboard Help", 0x07, 0x75, 0xFFFF},
    {L"Keyboard Menu", 0x07, 0x76, 0xFFFF},
    {L"Keyboard Select", 0x07, 0x77, 0xFFFF},
    {L"Keyboard Stop", 0x07, 0x78, 0xFFFF},
    {L"Keyboard Again", 0x07, 0x79, 0xFFFF},
    {L"Keyboard Undo", 0x07, 0x7A, 0xFFFF},
    {L"Keyboard Cut", 0x07, 0x7B, 0xFFFF},
    {L"Keyboard Copy", 0x07, 0x7C, 0xFFFF},
    {L"Keyboard Paste", 0x07, 0x7D, 0xFFFF},
    {L"Keyboard Find", 0x07, 0x7E, 0xFFFF},
    {L"Keyboard Mute", 0x07, 0x7F, 0xFFFF},
    {L"Keyboard Volume Up", 0x07, 0x80, 0xFFFF},
    {L"Keyboard Volume Down", 0x07, 0x81, 0xFFFF},
    {L"Keyboard Locking Caps Lock", 0x07, 0x82, 0xFFFF},
    {L"Keyboard Locking Num Lock", 0x07, 0x83, 0xFFFF},
    {L"Keyboard Locking Scroll Lock", 0x07, 0x84, 0xFFFF},
    {L"Keypad ,", 0x07, 0x85, 0xFFFF},
    {L"Keyboard Equal Sign", 0x07, 0x86, 0xFFFF},
    {L"Keyboard Int’l 1", 0x07, 0x87, 0xFFFF},
    {L"Keyboard Int’l 2", 0x07, 0x88, 0xFFFF},
    {L"Keyboard Int’l 3", 0x07, 0x89, 0xFFFF},
    {L"Keyboard Int’l 4", 0x07, 0x8A, 0xFFFF},
    {L"Keyboard Int’l 5", 0x07, 0x8B, 0xFFFF},
    {L"Keyboard Int’l 6", 0x07, 0x8C, 0xFFFF},
    {L"Keyboard Int’l 7", 0x07, 0x8D, 0xFFFF},
    {L"Keyboard Int’l 8", 0x07, 0x8E, 0xFFFF},
    {L"Keyboard Int’l 9", 0x07, 0x8F, 0xFFFF},
    {L"Keyboard Lang 1", 0x07, 0x90, 0xFFFF},
    {L"Keyboard Lang 2", 0x07, 0x91, 0xFFFF},
    {L"Keyboard Lang 3", 0x07, 0x92, 0xFFFF},
    {L"Keyboard Lang 4", 0x07, 0x93, 0xFFFF},
    {L"Keyboard Lang 5", 0x07, 0x94, 0xFFFF},
    {L"Keyboard Lang 6", 0x07, 0x95, 0xFFFF},
    {L"Keyboard Lang 7", 0x07, 0x96, 0xFFFF},
    {L"Keyboard Lang 8", 0x07, 0x97, 0xFFFF},
    {L"Keyboard Lang 9", 0x07, 0x98, 0xFFFF},
    {L"Keyboard Alternate Erase", 0x07, 0x99, 0xFFFF},
    {L"Keyboard SysReq/Attention", 0x07, 0x9A, 0xFFFF},
    {L"Keyboard Cancel", 0x07, 0x9B, 0xFFFF},
    {L"Keyboard Clear", 0x07, 0x9C, 0xFFFF},
    {L"Keyboard Prior", 0x07, 0x9D, 0xFFFF},
    {L"Keyboard Return", 0x07, 0x9E, 0xFFFF},
    {L"Keyboard Separator", 0x07, 0x9F, 0xFFFF},
    {L"Keyboard Out", 0x07, 0xA0, 0xFFFF},
    {L"Keyboard Oper", 0x07, 0xA1, 0xFFFF},
    {L"Keyboard Clear/Again", 0x07, 0xA2, 0xFFFF},
    {L"Keyboard CrSel/Props", 0x07, 0xA3, 0xFFFF},
    {L"Keyboard ExSel", 0x07, 0xA4, 0xFFFF},
    {L"RESERVED", 0x07, 0xA5, 0xAAAA},
    //
    {L"RESERVED", 0x07, 0xDF, 0xAAAA},
    {L"Left Control", 0x07, 0xE0, 0x14},
    {L"Left Shift", 0x07, 0xE1, 0x12},
    {L"Left Alt", 0x07, 0xE2, 0x11},
    {L"Left GUI", 0x07, 0xE3, 0xE01F},
    {L"Right Control", 0x07, 0xE4, 0xE014},
    {L"Right Shift", 0x07, 0xE5, 0x59},
    {L"Right Alt", 0x07, 0xE6, 0xE011},
    {L"Right GUI", 0x07, 0xE7, 0xE027},
    {L"RESERVED", 0x07, 0xE8, 0xAAAA},
	{L"RESERVED", 0x07, 0xFFFF, 0xAAAA},
	{NULL, 0x00, 0x00, 0x00} //last marker
};

Sample Dump

Here is a sample of the USB HID scan codes of a ITC device.

Warning

The 62h, 61h, 05h, 71h and 52h keys at the top are NOT part of the USB keypad, they are direct keys (see my post about DirectKeyUI):

CK61num_scancodes

Unfortunately, I don't have these mappings for all devices and keypads and so you have to evaluate the dump files, to find the right scan codes.

Here is a sample of usbkey.txt of a CN3 with numeric phone style keypad:

######## dump of plane 0 ###########
iUSBkey[0] hex: 0x07,0x00,0x00,0x00,0x00,0x00	CodePage:0x07, ScanCode:0x00, KeyName:'No Event'
iUSBkey[1] hex: 0x07,0x01,0x00,0x00,0x00,0x00	CodePage:0x07, ScanCode:0x01, KeyName:'Overrun Error'
iUSBkey[2] hex: 0x07,0x02,0x00,0x00,0x00,0x00	CodePage:0x07, ScanCode:0x02, KeyName:'POST Fail'
iUSBkey[3] hex: 0x07,0x03,0x00,0x00,0x00,0x00	CodePage:0x07, ScanCode:0x03, KeyName:'Error Undefined'
iUSBkey[4] hex: 0x07,0x1E,0x00,0x00,0x00,0x16	CodePage:0x07, ScanCode:0x1E, KeyName:'1 !'
iUSBkey[5] hex: 0x07,0x1F,0x00,0x00,0x00,0x1E	CodePage:0x07, ScanCode:0x1F, KeyName:'2 @'
iUSBkey[6] hex: 0x07,0x20,0x00,0x00,0x00,0x26	CodePage:0x07, ScanCode:0x20, KeyName:'3 #'
iUSBkey[7] hex: 0x07,0x21,0x00,0x00,0x00,0x25	CodePage:0x07, ScanCode:0x21, KeyName:'4 $'
iUSBkey[8] hex: 0x07,0x22,0x00,0x00,0x00,0x2E	CodePage:0x07, ScanCode:0x22, KeyName:'5 %%'
iUSBkey[9] hex: 0x07,0x23,0x00,0x00,0x00,0x36	CodePage:0x07, ScanCode:0x23, KeyName:'6 ^'
iUSBkey[10] hex: 0x07,0x24,0x00,0x00,0x00,0x3D	CodePage:0x07, ScanCode:0x24, KeyName:'7 &'
iUSBkey[11] hex: 0x07,0x25,0x00,0x00,0x00,0x3E	CodePage:0x07, ScanCode:0x25, KeyName:'8 *'
iUSBkey[12] hex: 0x07,0x26,0x00,0x00,0x00,0x46	CodePage:0x07, ScanCode:0x26, KeyName:'9 ('
iUSBkey[13] hex: 0x07,0x27,0x00,0x00,0x00,0x45	CodePage:0x07, ScanCode:0x27, KeyName:'0 )'
iUSBkey[14] hex: 0x07,0x28,0x00,0x00,0x00,0x5A	CodePage:0x07, ScanCode:0x28, KeyName:'Return'
iUSBkey[15] hex: 0x07,0x29,0x00,0x00,0x00,0x76	CodePage:0x07, ScanCode:0x29, KeyName:'Escape'
iUSBkey[16] hex: 0x07,0x2A,0x00,0x00,0x00,0x66	CodePage:0x07, ScanCode:0x2A, KeyName:'Backspace'
iUSBkey[17] hex: 0x07,0x2B,0x00,0x00,0x00,0x0D	CodePage:0x07, ScanCode:0x2B, KeyName:'Tab'
iUSBkey[18] hex: 0x07,0x37,0x00,0x00,0x00,0x49	CodePage:0x07, ScanCode:0x37, KeyName:'. >'
iUSBkey[19] hex: 0x07,0x41,0x00,0x20,0x00,0x3E	CodePage:0x07, ScanCode:0x41, KeyName:'F8'
iUSBkey[20] hex: 0x07,0x42,0x00,0x20,0x00,0x26	CodePage:0x07, ScanCode:0x42, KeyName:'F9'
iUSBkey[21] hex: 0x07,0x51,0x00,0x01,0x00,0x72	CodePage:0x07, ScanCode:0x51, KeyName:'Down Arrow'
iUSBkey[22] hex: 0x07,0x52,0x00,0x01,0x00,0x75	CodePage:0x07, ScanCode:0x52, KeyName:'Up Arrow'
iUSBkey[23] hex: 0x07,0xE3,0x00,0x01,0x00,0x1F	CodePage:0x07, ScanCode:0xE3, KeyName:'Left GUI'
iUSBkey[24] hex: 0x07,0x3A,0x00,0x00,0x00,0x05	CodePage:0x07, ScanCode:0x3A, KeyName:'F1'
iUSBkey[25] hex: 0x07,0x3B,0x00,0x00,0x00,0x06	CodePage:0x07, ScanCode:0x3B, KeyName:'F2'
iUSBkey[26] hex: 0x07,0x3C,0x00,0x00,0x00,0x04	CodePage:0x07, ScanCode:0x3C, KeyName:'F3'
iUSBkey[27] hex: 0x07,0x3D,0x00,0x00,0x00,0x0C	CodePage:0x07, ScanCode:0x3D, KeyName:'F4'
iUSBkey[28] hex: 0x07,0x8B,0x00,0x02,0x01,0x02	CodePage:0x07, ScanCode:0x8B, KeyName:'Keyboard Int’l 5'
iUSBkey[29] hex: 0x07,0x90,0x00,0x02,0x02,0x01	CodePage:0x07, ScanCode:0x90, KeyName:'Keyboard Lang 1'
iUSBkey[30] hex: 0x0C,0xE9,0x00,0x02,0x01,0x01	CodePage:0x0C, ScanCode:0xE9, KeyName:'undefined'
--------------------------------------
######## dump of plane 1 ###########
iUSBkey[0] hex: 0x07,0x00,0x00,0x00,0x00,0x00	CodePage:0x07, ScanCode:0x00, KeyName:'No Event'
iUSBkey[1] hex: 0x07,0x01,0x00,0x00,0x00,0x00	CodePage:0x07, ScanCode:0x01, KeyName:'Overrun Error'
iUSBkey[2] hex: 0x07,0x02,0x00,0x00,0x00,0x00	CodePage:0x07, ScanCode:0x02, KeyName:'POST Fail'
iUSBkey[3] hex: 0x07,0x03,0x00,0x00,0x00,0x00	CodePage:0x07, ScanCode:0x03, KeyName:'Error Undefined'
iUSBkey[4] hex: 0x07,0x1E,0x00,0x00,0x00,0x05	CodePage:0x07, ScanCode:0x1E, KeyName:'1 !'
iUSBkey[5] hex: 0x07,0x1F,0x00,0x00,0x00,0x1E	CodePage:0x07, ScanCode:0x1F, KeyName:'2 @'
iUSBkey[6] hex: 0x07,0x20,0x00,0x00,0x00,0x06	CodePage:0x07, ScanCode:0x20, KeyName:'3 #'
iUSBkey[7] hex: 0x07,0x21,0x00,0x00,0x00,0x25	CodePage:0x07, ScanCode:0x21, KeyName:'4 $'
iUSBkey[8] hex: 0x07,0x22,0x00,0x00,0x00,0x2E	CodePage:0x07, ScanCode:0x22, KeyName:'5 %%'
iUSBkey[9] hex: 0x07,0x23,0x00,0x00,0x00,0x36	CodePage:0x07, ScanCode:0x23, KeyName:'6 ^'
iUSBkey[10] hex: 0x07,0x24,0x00,0x00,0x00,0x3D	CodePage:0x07, ScanCode:0x24, KeyName:'7 &'
iUSBkey[11] hex: 0x07,0x25,0x00,0x00,0x00,0x3E	CodePage:0x07, ScanCode:0x25, KeyName:'8 *'
iUSBkey[12] hex: 0x07,0x26,0x00,0x00,0x00,0x46	CodePage:0x07, ScanCode:0x26, KeyName:'9 ('
iUSBkey[13] hex: 0x07,0x27,0x00,0x00,0x00,0x45	CodePage:0x07, ScanCode:0x27, KeyName:'0 )'
iUSBkey[14] hex: 0x07,0x28,0x00,0x00,0x00,0x5A	CodePage:0x07, ScanCode:0x28, KeyName:'Return'
iUSBkey[15] hex: 0x07,0x29,0x00,0x02,0x04,0x02	CodePage:0x07, ScanCode:0x29, KeyName:'Escape'
iUSBkey[16] hex: 0x07,0x2A,0x00,0x00,0x00,0x66	CodePage:0x07, ScanCode:0x2A, KeyName:'Backspace'
iUSBkey[17] hex: 0x07,0x2B,0x00,0x00,0x04,0x03	CodePage:0x07, ScanCode:0x2B, KeyName:'Tab'
iUSBkey[18] hex: 0x07,0x37,0x00,0x02,0x02,0x03	CodePage:0x07, ScanCode:0x37, KeyName:'. >'
iUSBkey[19] hex: 0x07,0x41,0x00,0x00,0x00,0x4E	CodePage:0x07, ScanCode:0x41, KeyName:'F8'
iUSBkey[20] hex: 0x07,0x42,0x00,0x20,0x00,0x55	CodePage:0x07, ScanCode:0x42, KeyName:'F9'
iUSBkey[21] hex: 0x07,0x51,0x00,0x01,0x00,0x74	CodePage:0x07, ScanCode:0x51, KeyName:'Down Arrow'
iUSBkey[22] hex: 0x07,0x52,0x00,0x01,0x00,0x6B	CodePage:0x07, ScanCode:0x52, KeyName:'Up Arrow'
iUSBkey[23] hex: 0x07,0xE3,0x00,0x10,0x00,0x1F	CodePage:0x07, ScanCode:0xE3, KeyName:'Left GUI'
iUSBkey[24] hex: 0x07,0x3C,0x00,0x00,0x00,0x04	CodePage:0x07, ScanCode:0x3C, KeyName:'F3'
iUSBkey[25] hex: 0x07,0x3D,0x00,0x00,0x00,0x0C	CodePage:0x07, ScanCode:0x3D, KeyName:'F4'
iUSBkey[26] hex: 0x07,0x8B,0x00,0x02,0x01,0x02	CodePage:0x07, ScanCode:0x8B, KeyName:'Keyboard Int’l 5'
iUSBkey[27] hex: 0x07,0x90,0x00,0x02,0x02,0x01	CodePage:0x07, ScanCode:0x90, KeyName:'Keyboard Lang 1'
iUSBkey[28] hex: 0x0C,0xE9,0x00,0x02,0x01,0x01	CodePage:0x0C, ScanCode:0xE9, KeyName:'undefined'
--------------------------------------
######## dump of plane 2 ###########
iUSBkey[0] hex: 0x07,0x00,0x00,0x00,0x00,0x00	CodePage:0x07, ScanCode:0x00, KeyName:'No Event'
iUSBkey[1] hex: 0x07,0x01,0x00,0x00,0x00,0x00	CodePage:0x07, ScanCode:0x01, KeyName:'Overrun Error'
iUSBkey[2] hex: 0x07,0x02,0x00,0x00,0x00,0x00	CodePage:0x07, ScanCode:0x02, KeyName:'POST Fail'
iUSBkey[3] hex: 0x07,0x03,0x00,0x00,0x00,0x00	CodePage:0x07, ScanCode:0x03, KeyName:'Error Undefined'
iUSBkey[4] hex: 0x07,0x1E,0x00,0x00,0x08,0x04	CodePage:0x07, ScanCode:0x1E, KeyName:'1 !'
iUSBkey[5] hex: 0x07,0x1F,0x00,0x02,0x40,0x01	CodePage:0x07, ScanCode:0x1F, KeyName:'2 @'
iUSBkey[6] hex: 0x07,0x20,0x00,0x02,0x40,0x02	CodePage:0x07, ScanCode:0x20, KeyName:'3 #'
iUSBkey[7] hex: 0x07,0x21,0x00,0x02,0x40,0x03	CodePage:0x07, ScanCode:0x21, KeyName:'4 $'
iUSBkey[8] hex: 0x07,0x22,0x00,0x02,0x40,0x04	CodePage:0x07, ScanCode:0x22, KeyName:'5 %%'
iUSBkey[9] hex: 0x07,0x23,0x00,0x02,0x40,0x05	CodePage:0x07, ScanCode:0x23, KeyName:'6 ^'
iUSBkey[10] hex: 0x07,0x24,0x00,0x02,0x40,0x06	CodePage:0x07, ScanCode:0x24, KeyName:'7 &'
iUSBkey[11] hex: 0x07,0x25,0x00,0x02,0x40,0x07	CodePage:0x07, ScanCode:0x25, KeyName:'8 *'
iUSBkey[12] hex: 0x07,0x26,0x00,0x02,0x40,0x08	CodePage:0x07, ScanCode:0x26, KeyName:'9 ('
iUSBkey[13] hex: 0x07,0x27,0x00,0x00,0x00,0x29	CodePage:0x07, ScanCode:0x27, KeyName:'0 )'
iUSBkey[14] hex: 0x07,0x28,0x00,0x00,0x00,0x5A	CodePage:0x07, ScanCode:0x28, KeyName:'Return'
iUSBkey[15] hex: 0x07,0x29,0x00,0x00,0x00,0x76	CodePage:0x07, ScanCode:0x29, KeyName:'Escape'
iUSBkey[16] hex: 0x07,0x2A,0x00,0x00,0x00,0x66	CodePage:0x07, ScanCode:0x2A, KeyName:'Backspace'
iUSBkey[17] hex: 0x07,0x2B,0x00,0x00,0x00,0x0D	CodePage:0x07, ScanCode:0x2B, KeyName:'Tab'
iUSBkey[18] hex: 0x07,0x37,0x00,0x00,0x00,0x49	CodePage:0x07, ScanCode:0x37, KeyName:'. >'
iUSBkey[19] hex: 0x07,0x41,0x00,0x20,0x00,0x3E	CodePage:0x07, ScanCode:0x41, KeyName:'F8'
iUSBkey[20] hex: 0x07,0x42,0x00,0x20,0x00,0x26	CodePage:0x07, ScanCode:0x42, KeyName:'F9'
iUSBkey[21] hex: 0x07,0x51,0x00,0x01,0x00,0x74	CodePage:0x07, ScanCode:0x51, KeyName:'Down Arrow'
iUSBkey[22] hex: 0x07,0x52,0x00,0x01,0x00,0x6B	CodePage:0x07, ScanCode:0x52, KeyName:'Up Arrow'
iUSBkey[23] hex: 0x07,0xE3,0x00,0x10,0x00,0x1F	CodePage:0x07, ScanCode:0xE3, KeyName:'Left GUI'
iUSBkey[24] hex: 0x07,0x3C,0x00,0x00,0x00,0x04	CodePage:0x07, ScanCode:0x3C, KeyName:'F3'
iUSBkey[25] hex: 0x07,0x3D,0x00,0x00,0x00,0x0C	CodePage:0x07, ScanCode:0x3D, KeyName:'F4'
iUSBkey[26] hex: 0x07,0x8B,0x00,0x02,0x01,0x02	CodePage:0x07, ScanCode:0x8B, KeyName:'Keyboard Int’l 5'
iUSBkey[27] hex: 0x07,0x90,0x00,0x02,0x02,0x01	CodePage:0x07, ScanCode:0x90, KeyName:'Keyboard Lang 1'
iUSBkey[28] hex: 0x0C,0xE9,0x00,0x02,0x01,0x01	CodePage:0x0C, ScanCode:0xE9, KeyName:'undefined'
--------------------------------------

See also readme.txt and sample dump included in attached file.

<!-- Social Bookmarks BEGIN -->

<!-- Social Bookmarks END -->

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)