This is an old revision of the document!
Work In Progress
Written By Dominic Clifton (C) 2007
Data is transferred two and from the Ergodex DX1's second interface (the first interface is a HID USB Keyboard) in multiple of 16 bytes.
After snooping the USB communications between the host machine and the Ergodex DX1 I've found out the following information (which is incomplete, please
16 bytes per command.
Byte 1: Command Code Bytes 2-16: Command Data
Usage
Program up to 4 keys per command
Command Code
0x03
Command Data
3 bytes per key (below) If a key is not to be programmed then pad the command with 0x00's
Then for each key that has a single key macro assigned to it sends 3 bytes
Key types:
0x01 - “Single Key” 0x02 - “Modifier Key” 0x03 - “Macro”
When key is:
Byte 3: Keyboard Scan Code
See Keyboard Scan Code Specification [References 1,2] Appendix C: USB Keyboard/Keypad Page (0x07)
Byte 3:
0x01 LEFT CTRL 0x02 LEFT SHIFT 0x04 LEFT ALT 0x08 LEFT WIN KEY (Left GUI Key) 0x10 RIGHT CTRL 0x20 RIGHT SHIFT 0x40 RIGHT ALT 0x80 RIGHT WIN KEY (Right GUI Key)
Byte 3: Empty Value (0x00)
TODO: Snoop what is sent by the HID interface when a key is assigned a macro
Example of command sent when switching to an application that has a profile enabled for it.
000421: Bulk or Interrupt Transfer (UP), 05.02.2007 20:27:53.4687500 +0.1093750 Pipe Handle: 0x87ca8884 (Endpoint Address: 0x2) Send 0x70 bytes to the device: 03 01 01 1E 02 01 1F 03 01 20 04 01 21 05 01 22 ......... ..!.." 03 06 01 23 07 01 24 08 01 25 09 01 26 0A 01 27 ...#..$..%..&..' 03 0B 01 14 0C 01 1A 0D 01 08 0E 01 15 0F 01 17 ................ 03 10 01 1C 11 01 18 12 01 0C 13 01 12 14 01 13 ................ 03 15 01 04 16 01 16 17 01 07 18 01 09 19 01 0A ................ 03 29 01 1D 2A 01 1B 2B 01 06 2C 01 19 00 00 00 .)..*..+..,..... 02 00 00 01 00 00 01 01 00 00 00 00 00 00 00 00 ................
Usage
Sent after one or more “Program Keys” commands.
Command Code
0x02
Command Data
00 00 01 00 00 01 01 00 00 00 00 00 00 00 00
Contents unknown at present.
Very similar (only one bit difference) to “Start Programming”
Usage
Sent when device is idle. Sent before one or more “Program Keys” commands.
Command Code
0x02
Command Data
00 00 01 00 01 01 01 00 00 00 00 00 00 00 00
Contents unknown at present.
Usage
Sent when device is idle.
Command Code
0x0A
Command Data
Fill with 0x00's
Command Response:
16 bytes
First byte: 0x0A Next 8 bytes: encoded serial number? Next 2 bytes: binary status flags? Next 5 bytes: filled with 0x00, more status flags?
- Key Support, Keyboard Scan Codes, and Windows
http://www.microsoft.com/whdc/device/input/Scancode.mspx
- Keyboard Scan Code Specification
http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc