I have a three button footpedal (VEC-USB-3-Infinity-Digital-Control) that is used for dictation software. I don’t like having to use the footpedal and would like to use button presses on a mouse or keypresses on a generic keyboard to act like each of the three buttons on the footpedal.
So far, I have used wireshark to obtain the report descriptor from the footpedal and I have been able to fully emulate the 3 buttons of the footpedal using a macropad (keybow 2040) that is running circuitpython on a rp2040 with the below collection of snippets.
It seems like hid-remapper will let me use a generic keyboard to emulate the footpedal, but may not be set up to identify this type of device (consumer page, programmable button). Can it capture this device, perhaps using the “custom usages” option in the configuration webpage, or will it need some modification to the source code? I would welcome some pointers on how to proceed (Monitor tab didn’t find anything when I pushed the buttons on the footpedal when it was connected to the 2040 feather board and the configuration page able to find and connect to the board).
Thank you.
FOOTPAD_REPORT_DESCRIPTOR = bytes((
0x05, 0x0C, # Usage Page (Consumer)
0x09, 0x03, # Usage (Programmable Buttons)
0xA1, 0x01, # Collection (Application)
0x05, 0x09, # Usage Page (Button)
0x19, 0x01, # Usage Minimum (0x01)
0x29, 0x03, # Usage Maximum (0x03)
0x15, 0x00, # Logical Minimum (0)
0x25, 0x01, # Logical Maximum (1)
0x95, 0x03, # Report Count (3) Button? (1 bit per each of 3 buttons)
0x75, 0x01, # Report Size (1)
0x81, 0x02, # Input
0x95, 0x01, # Report Count (1)
0x75, 0x05, # Report Size (5) 5 bits of padding?
0x81, 0x01, # Input
0x95, 0x01, # Report Count (1)
0x75, 0x08, # Report Size (8) 8 bits of padding?
0x81, 0x01, # Input
0xC0, # End Collection
)) # 67 bytes
footpad = usb_hid.Device(
report_descriptor=FOOTPAD_REPORT_DESCRIPTOR,
usage_page=0x0C, #
usage=0x03, #
report_ids=(0,), #
in_report_lengths=(2,), # This footpad sends 3 bits of data + 5 bits of padding + 8 bits of padding in its report.
out_report_lengths=(0,), # It does not receive any reports.
)
supervisor.set_usb_identification(
manufacturer='VEC',
product='VEC USB Footpedal',
vid=0x05F3,
pid=0x00FF
)