Skip to content

Change board PID & VID

vike256 edited this page Jan 16, 2024 · 7 revisions

This is a guide on how to change your microcontroller's device IDs. This can be used to make the microcontoller input look like it is coming from an actual mouse instead of a microcontroller.

Arduino

  1. Locate C:\Program Files (x86)\Arduino\hardware\arduino\avr\boards.txt
  2. Copy Arduino Leonardo's section and paste it to the bottom
  3. Replace 'leonardo' with something else
  4. Change all vid & pid values to the same as your mouse
  5. Change 'build.usb_product' to your mouse's name

If you want to disable the COM port add -DCDC_DISABLED to the line leonardo.build.extra_flags={build.usb_flags}
To re-enable COM port: https://github.com/khanxbahria/MouseInstruct#re-enable-cdc-serial

Raspberry

  1. Locate \AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.6.0\boards.txt
  2. Copy Raspberry Pi Pico W's section and paste it to the bottom
  3. Replace 'rpipicow' with something else
  4. Change all vid & pid values to the same as your mouse
  5. Change 'build.usb_manufacturer' and 'build.usb_product' to your mouse's manufacturer and name
  6. Locate \AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.6.0\cores\rp2040\RP2040USB.cpp
  7. CTRL-F 'if (__USBInstallMouse || __USBInstallAbsoluteMouse)'
  8. Change 0x4000 to 0x0000 in the if statement
Clone this wiki locally