An OpenVR driver that allows to create virtual controllers, emulate controller input, enable motion compensation, manipulate poses of existing controllers and remap buttons. Includes a dashboard to configure some settings directly in VR, a command line client for more advanced settings, and a client-side library to support development of third-party applications.
The OpenVR driver hooks into the HTC Vive lighthouse driver and allows to modify any pose updates or button/axis events coming from the Vive controllers before they reach the OpenVR runtime. Due to the nature of this hack the driver may break when Valve decides to update the driver-side OpenVR API.
The motivation of this driver is that I want to make myself a tracked gun that is guaranteed to work in any SteamVR game regardless of whether the original dev wants to support tracked guns or not. To accomplish this I need some way to add translation and rotation offsets to the poses of the motion controllers so that I can line up my tracked gun and the gun in the game. Additionally I need a way to easily switch between the tracking puck on my gun and my motion controller with the game thinking it's still the same controller (Throwing grenades with a tracked gun is not fun). But this driver should also support other use cases.
There is also a client-side API which other programs can use to communicate with the driver. This API should be powerful enough to also support the development of full-fledged motion-controller drivers.
This is a work-in-progress and may contain bugs.
Download the newest installer from the release section and then execute it. Don't forget to exit SteamVR before installing/de-installing.
Download the newest command-line client from the release section, unzip it, and then execute the contained binary in a cmd window. Enter 'client_commandline.exe help' on the command line for usage instructions.
There is an Oculus Touch specific fix available for Fallout 4 VR. It allows to emulate trackpad behaviour with the Rift's joysticks. Therefore, on the input remapping pages of each analog axis a touchpad emulation mode can be configured.
Currently there are two modes available:
Position Based: This modes assumes that the joystick can only move further away from the center position. All newer positions smaller can the last known position are ignored. The saved highest position is reset when the center position has been reached. The idea is to ignore input events caused by the joystick snapping back to center position. As soon as the center position is reached it is immediately send to the application in a position update. This helps with movement controls as otherwise any movement in an application is not reset when the joystick is let go by the user, and FO4 menus ignore this position update. However, the pipboy map does not ignore this position update.
Position Based (Deferred Zero Update): This modes works exactly the same as the mode above with one small difference. The position update when the center position is reached is not immediately send but only when the joystick starts moving again. This helps with the pipboy-map but messes up movement controls. To still be able to move you can configure a toggle button to turn on/off touchpad emulation mode (see below).
To enable/disable the touchpad emulation mode at will you can configure a toggle binding on any digital button. Therefore, select a digital button, select either normal, double or long press, and then select "Toggle Touchpad Emulation" as binding type. Now with audio cue.
FO4 also tends to ignore joystick clicks when the joystick is exactly at center position. To help with this you can also activate the deadzone fix for button presses on the analog input remapping page).
Redirect mode allows to redirect the pose updates and controller events from one controller to another. To enable it select the device from with the pose updates/controller events should be redirected, then set the device mode to "Redirect to" and select the device that should be the redirect target from the combo box on the right, and at last press 'Apply'.
Redirect mode can be temporarily suspended by re-mapping a controller button to a "suspend" action on the input remapping page.
Vel/Acc Compensation Mode: How should reported velocities and acceleration values be adjusted. The problem with only adjusting the headset position is that pose prediction also takes velocity and acceleration into accound. As long as the reported values to not differ too much from the real values, pose prediction errors are hardly noticeable. But with fast movements of the motion platform the pose prediction error can be noticeable. Available modes are:
Lists all available controller inputs (as reported by OpenVR) and their remapping statuses.
Attention: When long and double presses are enabled normal controller input may be delayed because I first need to wait the specified thresholds before I can send a normal key event.
Allows to configure a digital button binding. Available binding types are:
Allows to configure an analog input. Available binding types are:
The touchpad emulation mode for this analog axis can also be configured here. Touchpad emulation mode tries to emulate the behaviour of a touchpad with a joystick. The primary purpose of this option is to make Fallout 4 VR playable with Oculus Rift controllers, but it can also be used for other games.
Available touch emulation modes:
Position Based: This modes assumes that the joystick can only move further away from the center position. All newer positions smaller can the last known position are ignored. The saved highest position is reset when the center position has been reached. The idea is to ignore input events caused by the joystick snapping back to center position. As soon as the center position is reached it is immediately send to the application in a position update. This helps with movement controls as otherwise any movement in an application is not reset when the joystick is let go by the user.
Position Based (Deferred Zero Update): This modes works exactly the same as the mode above with one small difference. The position update when the center position is reached is not immediately send but only when the joystick starts moving again. This helps with applications that have problems with the above mode but messes up movement controls.
Button Press Deadzone Fix: Some applications ignore touchpad/joystick clicks when the position is exactly the center position. This fix can help in this case by slightly offsetting the position when a click has been registered exactly at center position.
Lists all openvr devices.
buttonevent [press|pressandhold|unpress|touch|touchandhold|untouch] <openvrId> <buttonId> [<pressTime>]
Emulates a button event on the given device. See openvr.h for available button ids.
axisevent <openvrId> <axisId> <x> <y>
Emulates an axisevent on the given device. Valid axis ids are 0-4.
proximitysensor <openvrId> [0|1]
Emulates a proximity sensor event on the given device.
getdeviceproperty <openvrId> scan
Scans the given device for all available device properties.
getdeviceproperty <openvrId> <property> [int32|uint64|float|bool|string]
Returns the given device property. See openvr.h for valid property ids.
Lists all virtual devices managed by this driver.
addcontroller <serialnumber>
Creates a new virtual controller. Serialnumber needs to be unique. When the command is successful the id of the virtual controller is written to stdout.
publishdevice <virtualId>
Tells OpenVR that there is a new device. Before this command is called all device properties should have been set.
setdeviceproperty <virtualId> <property> [int32|uint64|float|bool|string] <value>
Sets the given device property. See openvr.h for valid property ids.
removedeviceproperty <virtualId> <property>
Removes the given device property. See openvr.h for valid property ids.
setdeviceconnection <virtualId> [0|1]
Sets the connection state of the given virtual device. Default value is disconnected.
setdeviceposition <virtualId> <x> <y> <z>
Sets the position of the given virtual device.
setdeviceposition <virtualId> <x> <y> <z>
setdevicerotation
ToDo. See vrinputemulator.h.
# Create virtual controller
client_commandline.exe addcontroller controller01 # Writes virtual device id to stdout (Let's assume it is 0)
# Set device properties
client_commandline.exe setdeviceproperty 0 1000 string lighthouse
client_commandline.exe setdeviceproperty 0 1001 string "Vive Controller MV"
client_commandline.exe setdeviceproperty 0 1003 string vr_controller_vive_1_5
client_commandline.exe setdeviceproperty 0 1004 bool 0
client_commandline.exe setdeviceproperty 0 1005 string HTC
client_commandline.exe setdeviceproperty 0 1006 string "1465809478 htcvrsoftware@firmware-win32 2016-06-13 FPGA 1.6/0/0 VRC 1465809477 Radio 1466630404"
client_commandline.exe setdeviceproperty 0 1007 string "product 129 rev 1.5.0 lot 2000/0/0 0"
client_commandline.exe setdeviceproperty 0 1010 bool 1
client_commandline.exe setdeviceproperty 0 1017 uint64 2164327680
client_commandline.exe setdeviceproperty 0 1018 uint64 1465809478
client_commandline.exe setdeviceproperty 0 1029 int32 2
client_commandline.exe setdeviceproperty 0 3001 uint64 12884901895
client_commandline.exe setdeviceproperty 0 3002 int32 1
client_commandline.exe setdeviceproperty 0 3003 int32 3
client_commandline.exe setdeviceproperty 0 3004 int32 0
client_commandline.exe setdeviceproperty 0 3005 int32 0
client_commandline.exe setdeviceproperty 0 3006 int32 0
client_commandline.exe setdeviceproperty 0 3007 int32 0
client_commandline.exe setdeviceproperty 0 5000 string icons
client_commandline.exe setdeviceproperty 0 5001 string {htc}controller_status_off.png
client_commandline.exe setdeviceproperty 0 5002 string {htc}controller_status_searching.gif
client_commandline.exe setdeviceproperty 0 5003 string {htc}controller_status_searching_alert.gif
client_commandline.exe setdeviceproperty 0 5004 string {htc}controller_status_ready.png
client_commandline.exe setdeviceproperty 0 5005 string {htc}controller_status_ready_alert.png
client_commandline.exe setdeviceproperty 0 5006 string {htc}controller_status_error.png
client_commandline.exe setdeviceproperty 0 5007 string {htc}controller_status_standby.png
client_commandline.exe setdeviceproperty 0 5008 string {htc}controller_status_ready_low.png
# Let OpenVR know that there is a new device
client_commandline.exe publishdevice 0
# Connect the device
client_commandline.exe setdeviceconnection 0 1
# Set the device position
client_commandline.exe setdeviceposition 0 -1 -1 -1
OpenVR-InputEmulator/third-party/LeapSDK
OpenVR-InputEmulator/third-party/boost_1_63_0
OpenVR-InputEmulator\client_overlay
client_overlay.vcxproj.user
and paste the following into it:<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<QTDIR>C:\Qt\5.7\msvc2015_64</QTDIR>
</PropertyGroup>
</Project>
NOTE: Adjust the path the msvc2015_64
folder in Qt to match your installation
This software is released under GPL 3.0.