djpnewton / vmulti

Virtual Multiple HID Driver (multitouch, mouse, digitizer, keyboard, joystick)
MIT License
401 stars 171 forks source link

Joystick support #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've been trying to add joystick support to the driver using the following 
report descriptor (see bottom). This is replacing the report descriptors given 
in vmulti.h.

The driver builds and install correctly but when I try and view "Properties" 
for the device under "Game Controllers" I get an error reading that "The game 
controller is not connected properly".

Do you have any advice or is there an example of this working?

Many thanks.

    0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)
    0x15, 0x00,                    // LOGICAL_MINIMUM (0)
    0x09, 0x04,                    // USAGE (Joystick)
    0xa1, 0x01,                    // COLLECTION (Application)
    0x05, 0x02,                    //   USAGE_PAGE (Simulation Controls)
    0x09, 0xbb,                    //   USAGE (Throttle)
    0x15, 0x81,                    //   LOGICAL_MINIMUM (-127)
    0x25, 0x7f,                    //   LOGICAL_MAXIMUM (127)
    0x75, 0x08,                    //   REPORT_SIZE (8)
    0x95, 0x01,                    //   REPORT_COUNT (1)
    0x81, 0x02,                    //   INPUT (Data,Var,Abs)
    0x05, 0x01,                    //   USAGE_PAGE (Generic Desktop)
    0x09, 0x01,                    //   USAGE (Pointer)
    0xa1, 0x00,                    //   COLLECTION (Physical)
    0x09, 0x30,                    //     USAGE (X)
    0x09, 0x31,                    //     USAGE (Y)
    0x95, 0x02,                    //     REPORT_COUNT (2)
    0x81, 0x02,                    //     INPUT (Data,Var,Abs)
    0xc0,                          //   END_COLLECTION
    0x09, 0x39,                    //   USAGE (Hat switch)
    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
    0x25, 0x03,                    //   LOGICAL_MAXIMUM (3)
    0x35, 0x00,                    //   PHYSICAL_MINIMUM (0)
    0x46, 0x0e, 0x01,              //   PHYSICAL_MAXIMUM (270)
    0x65, 0x14,                    //   UNIT (Eng Rot:Angular Pos)
    0x75, 0x04,                    //   REPORT_SIZE (4)
    0x95, 0x01,                    //   REPORT_COUNT (1)
    0x81, 0x02,                    //   INPUT (Data,Var,Abs)
    0x05, 0x09,                    //   USAGE_PAGE (Button)
    0x19, 0x01,                    //   USAGE_MINIMUM (Button 1)
    0x29, 0x04,                    //   USAGE_MAXIMUM (Button 4)
    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
    0x25, 0x01,                    //   LOGICAL_MAXIMUM (1)
    0x75, 0x01,                    //   REPORT_SIZE (1)
    0x95, 0x04,                    //   REPORT_COUNT (4)
    0x55, 0x00,                    //   UNIT_EXPONENT (0)
    0x65, 0x00,                    //   UNIT (None)
    0x81, 0x02,                    //   INPUT (Data,Var,Abs)
    0xc0                           // END_COLLECTION

Original issue reported on code.google.com by myownep...@yahoo.com on 29 Nov 2010 at 4:52

GoogleCodeExporter commented 9 years ago
I have added this joystick descriptor (with the small modification of having a 
report id) to the vmulti source repo along with a test in testvmulti.exe.

It seems to work ok (you can see the joystick properties changing in the game 
controller control panel applet.

Original comment by djpnew...@gmail.com on 30 Nov 2010 at 11:00

Attachments:

GoogleCodeExporter commented 9 years ago
That's strange, I actually tried this. There must have been a small difference 
some where - I will investigate. Thank you.

Original comment by myownep...@yahoo.com on 30 Nov 2010 at 12:07

GoogleCodeExporter commented 9 years ago
On closer inspection it seems that the problem is that my driver is not being 
reinstalled after I make a change. What is your workflow?

I'm running (in an x86 checked build environment)

> buildme.bat
> cd bin
> devcon remove hid\vmulti
> devcon install vmulti.inf hid\vmulti

The first installation (after clone) was fine (and I got a confirmation dialog) 
but every subsequent build returns "Drivers installed successfully".

But the actual controller profile doesn't update to reflect my changes (I think 
this was the problem originally!).

Am I doing anything obviously wrong?

Thank you!

Original comment by myownep...@yahoo.com on 30 Nov 2010 at 10:27

GoogleCodeExporter commented 9 years ago
"devcon remove" just deletes the device stack (doesnt actually remove the 
driver from the driver store)

you could try "DevCon Dp_delete" or "DevCon Update" but what I have been doing 
is just delete the vmulti device node from device manager and select the 
"delect driver files" checkbox (which I think removes the driver from the 
driver store)

Original comment by djpnew...@gmail.com on 1 Dec 2010 at 9:53

GoogleCodeExporter commented 9 years ago

Original comment by djpnew...@gmail.com on 24 Jan 2011 at 1:26

GoogleCodeExporter commented 9 years ago
How would I go about adding Z rotation reporting to the joystick? This is 
crucial to be able to use it in actual games.

Original comment by sim.nils...@gmail.com on 15 May 2013 at 4:22