summaryrefslogtreecommitdiffhomepage
path: root/tracker-steamvr/steamvr.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-04-03 19:49:41 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-04-06 04:29:50 +0200
commitf84cf70bad3833d6860228a080673cfa24aa59d7 (patch)
tree59011e5d29221c636c279e40df10b0c89e4259f6 /tracker-steamvr/steamvr.cpp
parentfb958d5418304995f04e997cc9df1bda14ebbd83 (diff)
tracker/steamvr: show device type before serial
Diffstat (limited to 'tracker-steamvr/steamvr.cpp')
-rw-r--r--tracker-steamvr/steamvr.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/tracker-steamvr/steamvr.cpp b/tracker-steamvr/steamvr.cpp
index ecc738a0..7b75952e 100644
--- a/tracker-steamvr/steamvr.cpp
+++ b/tracker-steamvr/steamvr.cpp
@@ -85,6 +85,16 @@ void device_list::fill_device_specs(QList<device_spec>& list)
continue;
}
+ switch (v->GetTrackedDeviceClass(k))
+ {
+ case vr::ETrackedDeviceClass::TrackedDeviceClass_HMD:
+ dev.type = "HMD"; break;
+ case vr::ETrackedDeviceClass::TrackedDeviceClass_Controller:
+ dev.type = "Controller"; break;
+ default:
+ dev.type = "Unknown"; break;
+ }
+
dev.model = str;
dev.pose = device_states[k];
dev.k = k;
@@ -254,7 +264,8 @@ steamvr_dialog::steamvr_dialog()
device_list list;
for (const device_spec& spec : list.devices())
- ui.device->addItem(QStringLiteral("%1 [%2]").arg(spec.model).arg(spec.serial), QVariant(spec.serial));
+ ui.device->addItem(QStringLiteral("<%3> %1 [%2]").arg(spec.model).arg(spec.serial).arg(spec.type),
+ QVariant(spec.serial));
tie_setting(s.device_serial, ui.device);
}