Skip to content
Python Bindings for vJoy (
Branch: master
Clone or download
tidzo Merge pull request #11 from dkhachatrian/master
Fix #1, update README as per #10
Latest commit d711a11 Mar 12, 2018


pyvjoy is a set of Python bindings for vJoy (

With this library you can easily set Axis and Button values on any vJoy device.  
Low-level bindings are provided in pyvjoy._sdk as well as a (hopefully) slightly more 'Pythonic' API in the pyvjoy.VJoyDevice() object.

Currently vJoyInterface.dll is looked for inside the pyvjoy directory only so place the desired version of that file there to use. (Note: this library currently only works with the x86 dll!)

"Pointy's Joystick Test App" is very useful when testing vJoy and this library:


import pyvjoy

#Pythonic API, item-at-a-time

j = pyvjoy.VJoyDevice(1)

#turn button number 15 on

#Notice the args are (buttonID,state) whereas vJoy's native API is the other way around.

#turn button 15 off again

#Set X axis to fully left
j.set_axis(pyvjoy.HID_USAGE_X, 0x1)

#Set X axis to fully right
j.set_axis(pyvjoy.HID_USAGE_X, 0x8000)

#Also implemented:


#The 'efficient' method as described in vJoy's docs - set multiple values at once
>>> <pyvjoy._sdk._JOYSTICK_POSITION_V2 at 0x....> = 19 # buttons number 1,2 and 5 (1+2+16) = 0x2000 0x7500

#send data to vJoy device

#Lower-level API just wraps the functions in the DLL as thinly as possible, with some attempt to raise exceptions instead of return codes.

You can’t perform that action at this time.