You need to edit the HID report descriptor, but also the main code. Change this portion of the HID descriptor:
0x05, 0x09, /* Usage Page (Button) */
0x09, 0x02, /* Usage (Button 2) */
0x09, 0x01, /* Usage (Button 1) */
0x15, 0x00, /* Logical Minimum (0) */
0x25, 0x01, /* Logical Maximum (1) */
0x75, 0x01, /* Report Size (1) */
0x95, 0x02, /* Report Count (2) */
0x81, 0x02, /* Input (Data, Variable, Absolute) */
0x75, 0x06, /* Report Size (6) */
0x95, 0x01, /* Report Count (1) */
0x81, 0x01, /* Input (Constant) */
0xc0 /* End Collection */
To this:
0x05, 0x09, /* Usage Page (Button) */
0x09, 0x03, /* Usage (Button 3) */
0x09, 0x02, /* Usage (Button 2) */
0x09, 0x01, /* Usage (Button 1) */
0x15, 0x00, /* Logical Minimum (0) */
0x25, 0x01, /* Logical Maximum (1) */
0x75, 0x01, /* Report Size (1) */
0x95, 0x03, /* Report Count (3) */
0x81, 0x02, /* Input (Data, Variable, Absolute) */
0x75, 0x06, /* Report Size (5) */
0x95, 0x01, /* Report Count (1) */
0x81, 0x01, /* Input (Constant) */
0xc0 /* End Collection */
And set the third bit of the Buttons element in the element in the CALLBACK_HID_Device_CreateHIDReport()
function of the main source file, i.e. to "push" the new third button, use:
if (ButtonStatus_LCL & BUTTONS_BUTTON1)
JoystickReport->Button |= (1 << 2);
A wizard-like tool may be cute the first time you use it, but then it gets in the way. A better method is a decent structure of the descriptors in memory, and a few helpful macros and other preprocessing logic so that you can supply the information at a higher level and the right bytes and bits automatically get filled in.
My USB stack for the PIC 18 works like that. You can install that and a bunch of other stuff from my software downloads page. The static USB setup is defined in two files. The templates for these are named QQQ_USB.INS.ASPIC and QQQ_USB0.INS.ASPIC in the SOURCE > PIC directory. First you define the VID/PID, which endpoints you use, and which transfer types per endpoint in the usb.ins.aspic file. Then you modify the descriptors in usb0.ins.aspic with the little bit you need to customize. Since it already knows things like the transfer types and buffer sizes, you leave those symbols alone and just change what's unique to your implementation. In most cases, that's only adjusting the manufacturer name and the product name. These you write as ordinary strings and a macro takes care of the proper formatting.
Best Answer
From: link
Permits distinguishing between two /dev/videoX entries from the same physical UVC device (that naturally share the same iProduct name).
This change matches current Windows behavior by prioritizing iFunction over iInterface, but unlike Windows it displays both iProduct and iFunction/iInterface strings when both are available.