This shows you the differences between two versions of the page.
usb_protocol_information [2007/02/12 20:01] hydra |
usb_protocol_information [2010/05/10 19:05] (current) |
||
---|---|---|---|
Line 22: | Line 22: | ||
Request data is different for each request. | Request data is different for each request. | ||
+ | |||
Line 47: | Line 48: | ||
</code> | </code> | ||
- | When the device is in this mode will cause a "Control" device "Key Test" event to be raised when pressing or releasing any key. However, if you press and hold one key and then press and hold another key you'll get a "Key Test" event with no key press information. Thus, you'll never be able to check for more than one key pressed at a time when in "Test" mode | + | When the device is in this mode will cause a "Control" device "Key Test" event to be raised when pressing or releasing any key. There is something rather odd about test mode though. If the RED LED is OFF you will receive up to 6 keypresses in the "Key Test" reponse. However, if the RED LED is ON and you press and hold one key and then press and hold another key you'll get a "Key Test" event with no key press information. Thus, you'll never be able to check for more than one key pressed at a time when in "Test" mode and the RED LED is ON. Weird. |
<code> | <code> | ||
Line 202: | Line 203: | ||
Fill with 0x00's | Fill with 0x00's | ||
+ | |||
+ | ==== Unknown Command 1 ==== | ||
+ | |||
+ | The Ergodex software sends this command when recording macros. It has the effect of momentarily turning of the red LED. The green LED remains on. The command it sent once a second and the red led blinks off once a second. | ||
+ | |||
+ | __Usage__ | ||
+ | |||
+ | Only seen being sent when the device is in "Test" mode. | ||
+ | |||
+ | __Request Code__ | ||
+ | |||
+ | 0x08 | ||
+ | |||
+ | __Request Data__ | ||
+ | |||
+ | Unknown. | ||
+ | |||
+ | Here's what the ergodex software sends (complete request, including command code). | ||
+ | |||
+ | <code> | ||
+ | 08 00 00 00 00 00 01 01 00 00 00 00 00 00 00 00 | ||
+ | </code> | ||
===== Event and Response Data ===== | ===== Event and Response Data ===== | ||
Line 225: | Line 248: | ||
This indicates the values are additive, it has been reported it's possible to assign a key to "Modifier Key" and use the value 0x07 which simulates pressing all the keys together. | This indicates the values are additive, it has been reported it's possible to assign a key to "Modifier Key" and use the value 0x07 which simulates pressing all the keys together. | ||
+ | |||
+ | |||
+ | |||
Line 263: | Line 289: | ||
* Byte 4: bit-mapped button status. | * Byte 4: bit-mapped button status. | ||
- | The last two bits indicate the current status of the buttons | + | The first two bits indicate the current status of the buttons |
0x00 - 00 - both buttons pressed | 0x00 - 00 - both buttons pressed | ||
Line 270: | Line 296: | ||
0x03 - 11 - no buttons pressed | 0x03 - 11 - no buttons pressed | ||
- | When these two bits are inversed they make up a bitmask of the button status. When inversed the first bit (lsb) is 1 when the hand button is pressed and the second bit is 1 when the record button is pressed. | + | When these two bits are inverted they make up a bitmask of the button status. When inverted the first bit (lsb) is 1 when the hand button is pressed and the second bit is 1 when the record button is pressed. |
+ | |||
+ | example: | ||
+ | <code> | ||
+ | #define PRES_EROGODEXDX1_OFFSET_STATUS_BUTTONS 0x04 | ||
+ | |||
+ | #define PRES_EROGDEXDX1_BITMASK_BUTTON_HAND ( 1 << 0 ) | ||
+ | #define PRES_EROGDEXDX1_BITMASK_BUTTON_RECORD ( 1 << 1 ) | ||
+ | |||
+ | BOOL bRecordButtonPressed = !(*(pResponseData + PRES_EROGODEXDX1_OFFSET_STATUS_BUTTONS) & PRES_EROGDEXDX1_BITMASK_BUTTON_RECORD); | ||
+ | BOOL bHandButtonPressed = !(*(pResponseData + PRES_EROGODEXDX1_OFFSET_STATUS_BUTTONS) & PRES_EROGDEXDX1_BITMASK_BUTTON_HAND); | ||
+ | </code> | ||
* Byte 5: keymap status | * Byte 5: keymap status | ||
Line 298: | Line 335: | ||
* Bytes 3-8: | * Bytes 3-8: | ||
- | when a key is pressed the values corresponds to number printed on the physical keys | + | When a key is pressed the values corresponds to number printed on the physical keys |
+ | |||
+ | If one key is pressed then byte 3 will be the number of the key pressed, bytes 4-8 will contain 0x00 | ||
- | if one key is pressed then byte 3 will be the number of the key pressed, bytes 4-8 will contain 0x00 | + | If two keys are pressed then byte 3 and 4 will contain the numbers of the key that are currently pressed in random order, bytes 5-8 will contain 0x00 |
- | if two keys are pressed then byte 3 and 4 will contain the numbers of the key that are currently pressed in random order, bytes 5-8 will contain 0x00 | + | ... and so on, up to 6 keys. |
- | and so on, up to 6 keys. | + | When all keys are released bytes 3-8 will be filled with 0x00. |
* Bytes 9-15: unknown (only seen filled with 0x00's) | * Bytes 9-15: unknown (only seen filled with 0x00's) | ||
Line 319: | Line 358: | ||
__Data__ | __Data__ | ||
- | The data for this response appears to be the same as the "Macro Key Pressed" response. | + | The data for this response appears to be the same as the "Macro Key Pressed" response, except that you will only ever receive information about 1 key being pressed instead of up to 6 when the RED LED is ON. If two keys are pressed Bytes 3-8 will be filled with 0x00. If the RED LED is OFF you'll receive information about multiple keys in bytes 3-8. See "Set Device", above. |
=== Device Information === | === Device Information === |