Capturing Controller Data
Any controller that connects to a Mac can be supported. What it takes is data: what the controller says about itself, and the packets it sends when you press each control. The maintainer owns few controllers, so your files are what makes support happen.
Gather what you can on any computer you have, then send it. macOS, Windows, and Linux each show different parts, so files from all three help most.
Contents
Before You Start
- Write down the VID:PID. It’s two 4-digit hex numbers, such as
045E:028E. It names the controller model. - Capture every mode and connection. One capture each for USB, Bluetooth, and the dongle, and for each mode (XInput, DInput, Switch, Mac). Many controllers show a new VID:PID in each mode. Write down how you entered the mode, such as “hold X while turning on”.
- Press the controls in this order, and write the order down if you change it:
- Nothing for 2 seconds.
- A, B, X, Y (or Cross, Circle, Square, Triangle).
- Left bumper, right bumper.
- Left trigger slowly all the way in and out, then the right trigger.
- D-pad up, right, down, left.
- Left stick: a full slow circle, then click it. Same for the right stick.
- Select or Back, Start, Home, then any extra buttons (Share, paddles, touchpad click).
- Tilt and turn the controller if it has motion.
On macOS
-
List controllers and find yours:
ojd controller list -
Capture packets while you press each control in order:
ojd controller capture <controller> --duration 20 --json > capture.jsonl -
Draft a record. Press each control again while it runs:
ojd record draft <controller> > draft.plist -
Save the HID descriptors and the USB tree:
ioreg -r -c IOHIDDevice -l -w0 > ioreg-hid.txt ioreg -p IOUSB -l -w0 > ioreg-usb.txt -
Bluetooth only: record with PacketLogger, from Apple’s Additional Tools for Xcode. Start it, connect the controller, press each control, then save the
.pklgfile.
<controller> is the name or VVVV:PPPP from step 1. See Command Reference for more.
On Windows
- Hardware IDs. Open Device Manager. Right-click the controller and choose Properties. On Details, pick Hardware Ids. Copy every line.
- Descriptors. Run USB Device Tree Viewer. Select the controller and choose File > Save Report.
- USB packets with Wireshark and USBPcap:
- Install Wireshark. Tick USBPcap in the installer, then restart.
- Unplug the controller.
- Open Wireshark. Each USBPcap interface is one root hub. Pick the one your controller’s port uses. If unsure, try each in turn.
- Start the capture, then plug the controller in.
- Press each control in order.
- Stop, then File > Save As a
.pcapngfile.
- Note the driver Windows used: Properties > Driver > Driver Details.
On Linux
-
Descriptors. Find the controller with
lsusb, then:sudo lsusb -v -d VVVV:PPPP > lsusb.txt -
Driver. Plug it in, then save what the kernel did and which driver took it (
xpad,hid-generic,hid-playstation, and so on):sudo dmesg | tail -50 > dmesg.txt lsusb -t > lsusb-tree.txt - HID reports. Install hid-tools (
pip install hid-tools), then runsudo hid-recorder, pick the controller, and press each control in order. Save the output. - USB packets with usbmon and Wireshark:
- Run
sudo modprobe usbmon. - Note the bus number from
lsusb(Bus 003meansusbmon3). - Unplug the controller. Start Wireshark with
sudo wiresharkand capture on thatusbmoninterface. - Plug the controller in and press each control in order.
- Stop, then save a
.pcapngfile.
- Run
- Bluetooth packets. Run
sudo btmon -w bluetooth.snoop, connect the controller, press each control, then stop with Control-C.
Find What Others Know
Search for the VID:PID and the controller’s name, and link what you find:
- Linux drivers: xpad.c and the
hid-*.cdrivers. - SDL: controller_list.h and SDL_GameControllerDB.
- Steam Input, and other drivers or apps that support it.
- The maker’s manual, especially how to switch modes.
- Forum threads that name the firmware version and the mode.
Links to GPL drivers are welcome. OJD takes IDs and byte values from them and writes its own code.
Send It
Open a Controller Support issue and attach the files. Zip them if there are many. Name each file with the system, connection, and mode, such as linux-usb-xinput.pcapng.
You can also open a pull request with a record, or ask in Discussions.
Note
Captures hold only what the controller sends. Check the ioreg and dmesg files before you attach them: they can name your Mac or PC and other devices.