Standard versus Virtual Joystick

To better understand how vJoy devices function in Windows environment, I wish do compare a system with a Standard Joystick device to a system where a vJoy device driver is installed:

Standard Joystick

System with Standard Joystick

Figure 1 describes a system with a standard joystick hardware.The joystick position is sent from the hardware through the HAL (Hardware Abstraction Layer) to the standard MS joystick driver. Whenever the Win32 application (e.g. simulator) polls Win32 sub-system for position data, the subsystem issues a request to the driver and the driver returns the most updated position data. Since the driver exposes the joystick device as a standard hid_device_system_game, the communication with the driver is well defined.

The Joystick Driver can create a separate hid_device_system_game device for every newly connected hardware up to the limit of 16 devices. Each device is attributed serial number. The joystick device' attributes such as Number of buttons, axes, axis-range and many others are sent by the hardware device to the driver when the hardware is connected or when the driver is installed or enabled. The driver uses these attributes when it creates an hid_device_system_game device. When an application needs to get information about a specific device it gets it through the Win32 sub-system.

 

Overview

vJoy device driver is a Kernel Mode Driver Framework (KMDF) filter driver.

vJoy supports up to sixteen virtual joystick devices. Each device supports up to 32 buttons, up to 8 axes and up to 4 POV hat switches (Continuous or 5-state).

The type of each device is hid_device_system_game which represents a standard joystick device.

By default, the supplied installer installs the vJoy driver and one vJoy device (Device number 1) that is pre-configured to feature eight buttons and eight axes. Later, the number of devices, their serial number and their configuration can be changed. It is also possible to alter the installer to provide a different default set-up

For older versions of vJoy read the following article.

What is a feeder

Let's assume you want to control an application such as a flight-simulator from the mouse. In this case the flight-simulator is the user-application. vJoy can translate the mouse coordinates (and wheel and buttons) into joystick positions, hence controlling the user-application. However, vJoy is a general-purpose driver. It was not design for mouse-to-joystick translation. You will have to write a simple feeder software to bridge the gap between the mouse and vJoy. The feeder will read the mouse data and feed vJoy driver with these data.

Which Feeder

Write a feeder that is compatible with the version of vJoy driver you deploy. For vJoy 2.0.0 and up write a feeder based on the latest SDK. The SDK contains sources and a ReadMe file that explains how to write and deploy a feeder.

A feeder can be written in C,C++ or C# - Examples written in C and C# are included in the SDK package.

For further information please refer to this document.

For older versions of vJoy read the following article.

Features

Vjoy architecture supports up to 16 virtual devices.

Each vJoy device can be individually configured:

Axes:

 

vJoyConfig Command-Line application is used to configure vJoy devices and to collect vJoy device status.

Use it on systems that cannot run vJoyConf or when you need to create a batch file.

Always run it in As Administrator

 

Syntax & Examples

vJoyConfig
Launch GUI
Note: This requires vJoyConfig to be copied into the vJoy directory, and for the system to be configured correctly.

vJoyConfig -h
Help text

vJoyConfig -t [[-c] Di... ]
Report current vJoy Configuration
Without any additional flags - list of vJoy device and their respective statuses.
-c The configuration report is in vJoyConfig command-line format. To be reused in batch file.
Di List of devices for which the command will print configuration information.
Note: Not using flag '-c' will result in a human-readable output format.

vJoyConfig -v
Version information

vJoyConfig -r
Reset vJoy to default configuration
Note: This operation is equivalent to deleting all configurations. vJoy will fall back into its default state which is Device #1 with 8 Axes and 8 Buttons.

vJoyConfig Enable [on | off]
Enable or Disable vJoy
driver . Default is 'on'
Note: This operation is useful if you need to disable all vJoy devices and then to enable them.

vJoyConfig -d Dn [Dn+1...]
Delete one or more devices - devices are in the 1-16 range
Note1: This operation may be applied to no-existing devices.
Note2: If all devices are removed - the operation is equivalent tp
 vJoyConfig -r.
Example: vJoyConfig -d 1 3 12
(Deletes devices 1, 3 and 12)

vJoyConfig Dn [-f][-l][-aAi [Ai+1 …]] [-bn] {[-pm] | [-sj]} [-e [{all | Ei ...}]]
Create a joystick device

  • D n The index of the target joystick device in the range of 1-16

  • -f Force creation even if device exists. This will delete the current device before creating a new one.

  • -l Defer creation of device until the next operation that enables the driver. See Notes.

  • -a  Ai Define axes (one or more).
    Possible values are (Case insensitive): x, y, z, rx, ry, rz, sl0, sl1
    In the absence of this flag the default will be used (Default = all axes)

  • -b  n Set the number of buttons (Possible values are 0 to 128; Default = 8 buttons)

  • -p  m Set the number of analog POV Switches (Possible values are 0 to 4; Default = 0)

  • -s j Set the number of discrete POV Switches (Possible values are 0 to 4; Default = 0)

  • -e Ei Define the required FFB Effect. Possible Effect Values are (Case Insensitive):

Const  Constant Force
Ramp Ramp Force
Sq Square Wave Force
Sine Sine Wave Force 
Tr Triangular Wave Force
StUp Sawtooth (Up) Wave Force
StDn Sawtooth (Down) Wave Force
Spr Spring
Dm Damper
Inr Inertia
Fric Friction
All All above FFB effects

 

 

 

 

 

 

 

 

 

 

 

Note1: This operation never modifies an existing device. It either leave it unchanged or override its configuration.
Note2: Use flag '-f' to overrite an existing device configuration
Note3: To create a new device only if absent - do not use flag '-f'
Note4: A device can include either  Analog or  Discrete POV switches
Note5: Omitting flag '-e' will result in a device that does not support FFB
Note6:  '-e all' is eqivalent to '-e const ramp sq sine tr stup stdn spr dm inr fric'

Example1: vJoyConfig 3 -f -a x y z rx -b 32 -p 4
( Create or override vJoy device 3 with 4 axes, 32 buttons and 4 analog POV switches - no FFB support) 

Example2: vJoyConfig 2  -a x y z rx -b 32 -p 4
( Create  vJoy device 2 with 4 axes, 32 buttons and 4 analog POV switches - unless a previous device 2 existed 
- no FFB support)

Example3: vJoyConfig 2  -f  -b 32 -p 4
( Create or override vJoy device 2 with all 8 axes, 32 buttons and 4 analog POV switches 
 - no FFB support  

Example4: vJoyConfig 5  -f 
( Create or override vJoy device 5 with all 8 axes and 8 buttons 
- no FFB support

Example5: vJoyConfig 2  -f  -b 32 -p 4 -e ramp spr
( Create or override vJoy device 2 with all 8 axes, 32 buttons and 4 analog POV switches - supports FFB effects Ramp and Spring)

Example6: vJoyConfig 5  -f -l -e all
( Create or override vJoy device 5 with all 8 axes and 8 buttons 
- supports all FFB effects - Deferred operation
 

How to Deploy

vJoyConfig is now part of the vJoy installation.

 (Usually located in C:\Program Files\vJoy\x64 or C:\Program Files\vJoy\x86).

Description of supplied installer:

The installation packages currently shipped (x86/x64) are constructed of several layers: