How to create your first vJoy Application

Rishav Ghosh
4 min readJul 9, 2020

Introduction

New technologies are being developed faster than ever. And new games even faster. Mostly everyone in the world wants to try out a new game but they can’t generally because of the absence of two main things:

1> The necessary PC requirements.

2> A controller.

To mitigate such problems developers are coming up with solutions that include using the cloud: the magical term used by every back-end engineer.The general template of such solutions is that the game will be hosted on a remote server, and the visual of the game will be sent to the user. So that he can stream a very big game like Grand Theft Auto from his phone,tablet or PC. Companies like Google have come up with solutions like Google Stadia which are capable of streaming video games up to 4K resolution at 60 frames per second. But the problem is that to fully use this service you need to also buy a proprietary controller manufactured by Google. So I guess the final barrier is to remove the controller from the equation.

So I decided to create a virtual game-pad emulator which can emulate the controllers that we use today . To develop such a controller I decided to use a vJoy developed by Shaul Eizikovich. The main problem of developing with drivers is the sheer lack of documentation.

vJoy

vJoy is a device driver that bridges the gap between any device that is not a joystick and an application that requires a joystick. If you develop an application for windows that requires user physical input you should consider incorporating vJoy into your product.

vJoy can be incorporated as-is or modified. vJoy can be used with fixed configuration or configurable. It also comes with tools and example code that feeds it with data and configure the virtual joystick.

vJoy is implemented as a joystick virtual-device driver for windows (XP and up) that does not represent an actual hardware device.

The vJoy device is seen by Windows as a standard joystick device. However, it receives its signals through a simple software interface. Coders can take advantage of this interface by modifying the provided sample code.

Normal Controllers
vJoy virtual controller

Architecture of vJoy

vJoy device driver exposes the virtual joystick device as a standard hid_device_system_game, the Win32 sub-system and the applications see the virtual device as a standard joystick device. The main difference between vJoy driver and a standard driver lies in the source of the position data and the source of the device’s attributes.

The position data is fed into the virtual device from a feeder that can be any software entity (Application, service, another driver) that interfaces with the virtual device through a well-defined protocol. It is strongly advised to interface indirectly through vJoyInterface.dll library. The details of the protocol are in article Writing a feeder application.

By default, the vJoy driver creates one hid_device_system_gamedevice when installed. The attributes of this virtual device are hard-coded in vJoy driver. Replacing the default virtual device with up to 16 configurable virtual devices is optional.

We basically do changes in the feeder application to develop a vJoy controller for our needs.

Building vJoy Feeder Application

1> Installing Visual Studio

Click on this link to download. vJoy is compiled on Visual Studio and thus it will be easier to compile it on this IDE.

2> Installing vJoy

First, go to this site. Then download vJoySetup.exe from here. Download the Feeder-SDK and also vJoyConfig Command line vJoy device configuration tool. Then you go to the folder SDK/src and open the vJoyClient.sln:

The .sln file that needs to be read by VS

3> Starting to code on vJoy

Remember, that vJoy is a C++ program and the solution files(*.sln) are compiled by Visual Studio so if you are thinking of deciding which IDE to use don’t just go for Visual Studio, its the best and is complements vJoy.

This is how the sln looks in VS

4> The various utilities on vJoy

vJoy Monitor: It monitors the the actions of ever vJoy device that is enabled
vJoy List: Shows the devices which are enabled and can be used
vJoyFeeder: Demonstrates the capabilities of vJoy and the usage of the API.

The Problems You Face

When you first compile the vJoyClient.sln on VS chances are it won’t compile instead it will gift hundreds of errors as a gift for your valiant efforts.

Resources You Take Help From

Check out Carpathian Byte: http://carpathianbyte.ro/home/index.php/portfolio/vjoy-implementation-using-data-from-wireless-imu/

Download Xpadder: https://www.techspot.com/downloads/5869-xpadder.html

Please check out more of my articles!!

--

--

Rishav Ghosh

Unlock Potential | Clarity, Confidence&Direction | SWE@Microsoft | FullStack Engineer | Cloud Enthusiast | Guitarist | LinkedIn: linkedin.com/in/rishavghosh605