vJoy SDK and pyvjoy: Write Your Own Feeder
Every feeder you have ever used, from Joystick Gremlin down to a twenty-line script, talks to vJoy the same way: through vJoyInterface.dll, the interface library the vJoy SDK documents and ships. If you can write a little code, you can write your own feeder, and the Python wrapper pyvjoy makes that first feeder an afternoon project rather than a systems-programming expedition. This guide explains what the SDK actually contains, how pyvjoy relates to the DLL underneath it, the one version-matching rule that decides whether your code works at all, and a sensible first project that proves the whole chain from your script to a game.
What the SDK ships
The vJoy SDK is the developer side of the same releases everyone else installs as a driver. It provides the vJoyInterface library in forms for C, C++ and C# developers, headers and documentation describing the interface functions, and demo feeder programs that show a complete, minimal write cycle: check the driver is present and enabled, acquire a device, write axis and button values, then relinquish the device cleanly. Those demos are the most valuable part of the package for a beginner, because they are known-good callers. When your own code fails, running the demo feeder separates a broken installation from a broken program instantly, which is the same diagnostic discipline as testing in joy.cpl before blaming a game.
The interface model in plain terms
Conceptually, vJoyInterface.dll exposes a small set of jobs. You ask whether a vJoy driver exists and which version it reports. You ask whether a specific device ID exists and whether it is free. You acquire that device so no other feeder fights you for it. Then you write values: axis positions across the device’s enabled axes, button states, and POV hat positions, either field by field or as a complete position block. Finally you relinquish the device when your feeder exits. Everything a feeder does, including respected tools like Joystick Gremlin and UCR, reduces to variations on those jobs. The virtual device itself, its ID, axes, buttons and POV count, is still defined beforehand in Configure vJoy. Your code writes values; it does not design the hardware.
pyvjoy: the Python wrapper
pyvjoy is a Python wrapper around vJoyInterface.dll. That sentence carries the two facts beginners miss. First, pyvjoy does not replace the DLL or the driver: it needs a working vJoy installation underneath, with the DLL available, because every call it makes lands in that native library. Second, because it is a wrapper, its programs follow the same model as the SDK demos, expressed in Python: create a device object for a chosen device ID, set axis values with the library’s expected value range, set and reset buttons by number, and let the object clean up on exit. The result is that a Python script can feed a game from sources Python is good at: serial data, network messages, sensor boards, computer vision output, or your own automation logic.
- Install vJoy itself first and configure a device in vJoyConf with the axes and buttons your script will write.
- Verify the device exists in joy.cpl and responds to the SDK demo feeder or another known feeder.
- Install pyvjoy in your Python environment and run a minimal script that acquires your device ID and moves one axis.
- Watch that axis in JoyMonitor while the script runs. Only extend the script once that single movement is reliable.
- Add buttons, then further axes, testing each addition, and make sure the script relinquishes the device when it ends.
The version-match rule
One rule governs all of this, for SDK code and pyvjoy alike: the driver and the DLL must come from the same release. The classic vJoy error, driver version does not match DLL, exists because a feeder shipped or loaded a vJoyInterface.dll from one release against a driver installed from another, such as a 2.1.8 DLL against a 2.1.9 driver. When you develop, be deliberate about which DLL your program loads, keep it with your project, and record the driver build it was tested against. When you distribute a feeder, ship or reference the DLL that matches the driver you tell users to install, and state that build in your instructions. Most support pain in this ecosystem is this single rule, ignored.
A sensible first project
Build a feeder that does one thing observably. A good first project reads a single real input you already own, perhaps a slider, a serial dial, or simply your script’s own slowly sweeping value, and writes it to one axis of device 1. Run it beside JoyMonitor and watch the axis track your input. Then add a button toggled by a key press. That tiny program exercises acquisition, axis writes, button writes and clean release, which is ninety percent of what larger feeders do. From there, realistic growth is obvious: read an Arduino over serial and you have reinvented the idea behind vJoySerialFeeder; add curves and merging and you are walking toward Joystick Gremlin’s territory with a proper appreciation of what it does for you.
Common mistakes
- Treating pyvjoy as the driver. Import errors aside, pyvjoy cannot work without vJoy installed and a device configured. Install and configure first.
- Acquiring the wrong device. Your code, vJoyConf and your test game must all agree on the device ID.
- Writing to axes that are not enabled. The device shape comes from vJoyConf. Enable what you write.
- Never relinquishing the device. A crashed or careless feeder that keeps a device acquired blocks the next feeder. Handle exit cleanly.
- Mixing SDK and driver versions. Same release for driver and DLL, recorded in your notes and your readme.
- Testing first inside a game. Test in JoyMonitor. The game is the last witness, not the first.
Frequently asked questions
Which language should I use? Use what you know. The SDK serves C, C++ and C# directly, and pyvjoy makes Python a first-class feeder language for scripts and hardware experiments. Can my feeder create devices? No. Devices are defined in Configure vJoy. Your feeder acquires and writes to existing devices. Can two of my scripts share one device? They would fight over values and one may fail to acquire it. Give each feeder its own device ID. Is vJoy an XInput device for my game code? No. vJoy devices are DirectInput. If your project needs an Xbox-style virtual pad, that is a different layer entirely, and recognising the boundary early will save your design a rewrite.
Keep going
Start from the vJoy download page if you need the installer again, and use the vJoy Setup hub as the index for this whole cluster. Two guides that pair naturally with this one are How to Use vJoy: Feeders Explained and Configure vJoy with vJoyConf. Read them in that order if you are building a setup from scratch: download choice first, installation second, configuration third, and only then time inside a game or simulator. That order prevents the most common wasted hour in this niche, which is debugging a feeder or a game for a driver problem that was visible in Windows all along.
