Arduino Due. How to change Vendor ID and Product ID of emulating mouse/keyboard.

Hello!

How to change Vendor ID and Product ID of emulating by Arduino Due mouse and keyboard ("Mouse and Keyboard libraries")

If anyone finds this, here's the answer:

Edit hardware/arduino/sam/boards.txt and set arduino_due_x_dbg.build.pid= for the product ID. Changing the build.vid won't work, though and you have to modify hardware/arduino/sam/cores/arduino/Arduino.h on line 198 where USB_VID is defined. The really interesting stuff happens in hardware/arduino/sam/cores/arduino/USB/USBCore.cpp then. Here you can modify the USB drivers behavior. Don't want it to return a Manufacturer string? Tell it to return false here at about line 436.