Skip to content

Commit 32ddabb

Browse files
committed
Add 'compatibility mode' option to use VIVE tracker input profile
SteamVR only exposes trackers through XR_HTCX_vive_tracker_interaction when their Prop_ControllerType_String is `vive_tracker_[role]`, but if we set that in our input profile unconditionally, it will bring back the 'no bindings' popup on Vive Tracker (Chest) for everyone, so just add an option gated behind 'Advanced Settings' to use the VIVE tracker profile.
1 parent ad8a940 commit 32ddabb

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"driver_slimevr": {
3+
"emulateVives": false
4+
}
5+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[
2+
{
3+
"title": "SlimeVR",
4+
"show_without_hmd": true,
5+
"values": [
6+
{
7+
"name": "/settings/driver_slimevr/emulateVives",
8+
"control": "toggle",
9+
"label": "Compatibility Mode",
10+
"on_label": "Enabled",
11+
"off_label": "Disabled",
12+
"advanced_only": true,
13+
"requires_restart": true
14+
}
15+
]
16+
}
17+
]

src/TrackerDevice.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ vr::EVRInitError SlimeVRDriver::TrackerDevice::Activate(uint32_t unObjectId) {
162162

163163
// Some device properties will be derived at runtime by SteamVR
164164
// using the profile, such as the device class and controller type
165-
GetDriver()->GetProperties()->SetStringProperty(props, vr::Prop_InputProfilePath_String, "{slimevr}/input/slimevr_tracker_profile.json");
165+
bool emulate_vives = vr::VRSettings()->GetBool("driver_slimevr", "emulateVives");
166+
std::string input_profile_path = emulate_vives ? "{htc}/input/vive_tracker_profile.json" : "{slimevr}/input/slimevr_tracker_profile.json";
167+
GetDriver()->GetProperties()->SetStringProperty(props, vr::Prop_InputProfilePath_String, input_profile_path.c_str());
166168

167169
// Doesn't apply until restart of SteamVR
168170
auto role = GetViveRole(tracker_role_);

0 commit comments

Comments
 (0)