Ports and Interfaces > USB
usb Usage type for HID not the same for windows.
ulao:
In windows I can use this list and its correct.
Generic Desktop
0x00 Undefined
0x01 Pointer
0x02 Mouse
0x03 Reserved
0x04 Joystick
0x05 Game Pad
0x06 Keyboard
0x07 Keypad
0x08 Multi-axis Controller
My devise is a Game Pad as it uses force feed back so I must use 0x05. Now in linux 0x05 shows up as a mouse? Does anyone have the list for linux ubuntu (debian). If the list is in fact not the same, how is a developer going to deal with that?
Jan Axelson:
These values are from the USB-IF's HID Usage tables document.
I don't know what you mean by "in linux 0x05 shows up as a mouse."
Jan
ulao:
Just simply that. If I do the following.
0x05,0x01, // Usage Page Generic Desktop
0x09,0x05, // Usage gamepad
0xA1,0x01, // Collection Application
In windows I get a gamepad. In linux ubuntu (debian) I get a mouse. Even if I move the x/y analogs on my stick it will move the mouse. Looking in the device folder its a mouse.
On a side note:If I change 0x05 to 0x04 it now shows as a joystick and works that way. Though , this is no good because its now a joystick not a game pad, so windows wont use the FFB.
I'm told this implementation may not be the same for linux.
Jan Axelson:
Can you post the complete report descriptor?
Jan
ulao:
OMG, you crazzy! LOL .. ok you asked for it.
urr,ok I cant
--- Quote ---The following error or errors occurred while posting this message:The message exceeds the maximum allowed length (20000 characters).
--- End quote ---
I will have to remove the FFB stuff.
--- Code: ---///// gampad
0x05,0x01, // Usage Page Generic Desktop
0x09,0x05, // Usage gamepad
0xA1,0x01, // Collection Application
//axis
0x85,0x01, // Report ID 1
0x09, 0x01, // usage pointer
0xA1, 0x00, // COLLECTION (phys)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x06, // REPORT_COUNT (6)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255)
0x35, 0x00, // Physical Minimum (0)
0x46, 0xFF, 0x00, // Physical Minimum (255)
0x09, 0x30, // USAGE (X)
0x09, 0x31, // USAGE (Y)
0x09, 0x32, // USAGE (Z)
0x09, 0x33, // USAGE (Rx)
0x09, 0x34, // USAGE (Ry)
0x09, 0x35, // USAGE (Rz)
0x81, 0x02, // INPUT
0xC0, // COLLECTION (phys)
0x09, 0x01, // usage pointer
0xA1, 0x00, // COLLECTION (phys)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x02, // REPORT_COUNT (2)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255)
0x09, 0x36, // slider
0x09, 0x37, // dial
//0x09, 0x38, // wheel ( cant figure this out )
//0x09, 0x39, // hat ( can use many dirrections... )
0x81, 0x02, // INPUT
0xC0, // COLLECTION (phys)
//buttons
0x05, 0x09, // USAGE_PAGE (Button)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x18, // REPORT_COUNT (24)
0x19, 0x01, // USAGE_MINIMUM (Button 1)
0x29, 0x18, // USAGE_MAXIMUM (Button 24)
0x81, 0x02, // INPUT
0xC0
--- End code ---
If you need to see the FFB stuff see here
http://www.microchip.com/forums/tm.aspx?m=320225&mpage=2
post 35.
Navigation
[0] Message Index
[#] Next page
Go to full version