Skip to content

Instantly share code, notes, and snippets.

@bagong
Created May 20, 2016 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bagong/c47607bfa905210429b7a8fd99de1b0f to your computer and use it in GitHub Desktop.
Save bagong/c47607bfa905210429b7a8fd99de1b0f to your computer and use it in GitHub Desktop.
HID Data output Creative Gamepad Cobra 2 USB
Gamepad Creative Cobra 2 USB
HID.findAvailable
-> IdentityDictionary[ (1 -> a HIDInfo(, , IDs:1054, 4099, USB_041e_1003_14200000, , 272, -1)), (2 -> a HIDInfo(, Apple Mikey HID Driver, IDs:0, 0, , , 0, -1)), (4 -> a HIDInfo(Apple Inc., Apple Internal Keyboard / Trackpad, IDs:1452, 611, USB_05ac_0263_1d182000, , 546, -1)), (5 -> a HIDInfo(Apple Inc., Apple Internal Keyboard / Trackpad, IDs:1452, 611, USB_05ac_0263_1d182000, , 546, -1)), (0 -> a HIDInfo(Apple Inc., Apple Internal Keyboard / Trackpad, IDs:1452, 611, USB_05ac_0263_1d182000, , 546, -1)),
(3 ...etc...
h = HID.open(1054, 4099)
HID: path was not set specified yet, chosen the one with path: USB_041e_1003_14200000
open device 0x7fac62560a80
start polling thread for 1649805952
HID: Opened device: a HIDInfo(, , IDs:1054, 4099, USB_041e_1003_14200000, , 272, -1)
-> a HID
HIDFunc.usage( { |...args| args.postln; }, nil)
-> HIDFunc.usage(nil, nil, nil, nil)
Cursor-cross/circle (left side):
left
press
[ 0, 0, 48, 1, 12, a HIDElement(12: type: 2, usage: 1, 48), 0, a HID, anyUsage ]
release
[ 0.50196081399918, 128, 48, 1, 12, a HIDElement(12: type: 2, usage: 1, 48), 0, a HID, anyUsage ]
top
press
[ 0, 0, 49, 1, 13, a HIDElement(13: type: 2, usage: 1, 49), 0, a HID, anyUsage ]
release
[ 0.50196081399918, 128, 49, 1, 13, a HIDElement(13: type: 2, usage: 1, 49), 0, a HID, anyUsage ]
right
press
[ 1, 255, 48, 1, 12, a HIDElement(12: type: 2, usage: 1, 48), 0, a HID, anyUsage ]
release
[ 0.50196081399918, 128, 48, 1, 12, a HIDElement(12: type: 2, usage: 1, 48), 0, a HID, anyUsage ]
bottom
press
[ 1, 255, 49, 1, 13, a HIDElement(13: type: 2, usage: 1, 49), 0, a HID, anyUsage ]
release
[ 0.50196081399918, 128, 49, 1, 13, a HIDElement(13: type: 2, usage: 1, 49), 0, a HID, anyUsage ]
Button SELECT
press
[ 1, 1, 10, 9, 9, a HIDElement(9: type: 2, usage: 9, 10), 0, a HID, anyUsage ]
release
[ 0, 0, 10, 9, 9, a HIDElement(9: type: 2, usage: 9, 10), 0, a HID, anyUsage ]
Button START
press
[ 1, 1, 9, 9, 8, a HIDElement(8: type: 2, usage: 9, 9), 0, a HID, anyUsage ]
release
[ 0, 0, 9, 9, 8, a HIDElement(8: type: 2, usage: 9, 9), 0, a HID, anyUsage ]
Buttons x y z
x press
[ 1, 1, 4, 9, 3, a HIDElement(3: type: 2, usage: 9, 4), 0, a HID, anyUsage ]
x release
[ 0, 0, 4, 9, 3, a HIDElement(3: type: 2, usage: 9, 4), 0, a HID, anyUsage ]
y press
[ 1, 1, 5, 9, 4, a HIDElement(4: type: 2, usage: 9, 5), 0, a HID, anyUsage ]
y release
[ 0, 0, 5, 9, 4, a HIDElement(4: type: 2, usage: 9, 5), 0, a HID, anyUsage ]
z press
[ 1, 1, 6, 9, 5, a HIDElement(5: type: 2, usage: 9, 6), 0, a HID, anyUsage ]
z release
[ 0, 0, 6, 9, 5, a HIDElement(5: type: 2, usage: 9, 6), 0, a HID, anyUsage ]
Buttons ABC
A press
[ 1, 1, 1, 9, 0, a HIDElement(0: type: 2, usage: 9, 1), 0, a HID, anyUsage ]
A release
[ 0, 0, 1, 9, 0, a HIDElement(0: type: 2, usage: 9, 1), 0, a HID, anyUsage ]
B press
[ 1, 1, 2, 9, 1, a HIDElement(1: type: 2, usage: 9, 2), 0, a HID, anyUsage ]
B release
[ 0, 0, 2, 9, 1, a HIDElement(1: type: 2, usage: 9, 2), 0, a HID, anyUsage ]
C press
[ 1, 1, 3, 9, 2, a HIDElement(2: type: 2, usage: 9, 3), 0, a HID, anyUsage ]
C release
[ 0, 0, 3, 9, 2, a HIDElement(2: type: 2, usage: 9, 3), 0, a HID, anyUsage ]
Wheel slider:
up
[ 0.3548386991024, 11, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
[ 0.32258063554764, 10, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
[ 0.29032257199287, 9, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
[ 0.25806450843811, 8, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
[ 0.22580644488335, 7, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
[ 0.19354838132858, 6, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
[ 0.16129031777382, 5, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
[ 0.12903225421906, 4, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
[ 0.096774190664291, 3, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
[ 0.064516127109528, 2, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
down
[ 0.096774190664291, 3, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
[ 0.12903225421906, 4, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
[ 0.16129031777382, 5, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
[ 0.19354838132858, 6, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
[ 0.22580644488335, 7, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
[ 0.25806450843811, 8, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
[ 0.29032257199287, 9, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
[ 0.32258063554764, 10, 54, 1, 14, a HIDElement(14: type: 2, usage: 1, 54), 0, a HID, anyUsage ]
Buttons front
top left
[ 1, 1, 7, 9, 6, a HIDElement(6: type: 2, usage: 9, 7), 0, a HID, anyUsage ]
[ 0, 0, 7, 9, 6, a HIDElement(6: type: 2, usage: 9, 7), 0, a HID, anyUsage ]
top right
[ 1, 1, 8, 9, 7, a HIDElement(7: type: 2, usage: 9, 8), 0, a HID, anyUsage ]
[ 0, 0, 8, 9, 7, a HIDElement(7: type: 2, usage: 9, 8), 0, a HID, anyUsage ]
bottom left
[ 1, 1, 11, 9, 10, a HIDElement(10: type: 2, usage: 9, 11), 0, a HID, anyUsage ]
[ 0, 0, 11, 9, 10, a HIDElement(10: type: 2, usage: 9, 11), 0, a HID, anyUsage ]
bottom right
[ 1, 1, 12, 9, 11, a HIDElement(11: type: 2, usage: 9, 12), 0, a HID, anyUsage ]
[ 0, 0, 12, 9, 11, a HIDElement(11: type: 2, usage: 9, 12), 0, a HID, anyUsage ]
As far as I can see
- No repetetive buttons
- No pressure sensitivity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment