This shows you the differences between two versions of the page.
|
usb_protocol_information [2007/02/12 21:10] hydra |
usb_protocol_information [2010/05/10 19:05] (current) |
||
|---|---|---|---|
| Line 248: | 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 288: | 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 295: | 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 | ||