Skip to content

Commit fc55d53

Browse files
authored
Merge pull request #75 from SlimeVR/sapphire/compatibility-mode
Add 'compatibility mode' option to use VIVE tracker input profile
2 parents e02ef9b + 32ddabb commit fc55d53

3 files changed

Lines changed: 25 additions & 1 deletion

File tree

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)