I noticed SDL only encapsulates WinMM apis for Win32. I'm thinking about writing a lib which would use UsbHidApi.dll, which makes HID communications simpler, to get a better plugin. I found the protocol of my joystick by using a UsbHidApi demo, from packet values. Here is the protocol of my joystick, Logitech Cordless Rumblepad 2 :
Code:
Bit |Val|Expl.
0 |01 |REport ID
1 |80 |Left X (axis 1)
2 |7f |Left Y (axis 2)
3 |7f |Right X (axis 3)
4 |80 |Right Y (axis 4)
5 |08 |Hi : buttons 0-4, Lo : POV
6 |00 |Buttons 5-12
7 |02 |Mode : 02 : normal, 0a : reverse POV and left axis
note : value can vary
POV :
0 : up
1 : up-right
2 : right
3 : down-right
4 : down
5 : down-left
6 : left
7 : up-left
8 : centered