diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index 53500a3353..11d390fca4 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -138,6 +138,11 @@ void ViveControllerManager::deactivate() { _registeredWithInputMapper = false; } +bool ViveControllerManager::isHeadController() const { + vr::EDeviceActivityLevel activityLevel = _system->GetTrackedDeviceActivityLevel(vr::k_unTrackedDeviceIndex_Hmd); + return activityLevel == vr::k_EDeviceActivityLevel_UserInteraction; +} + void ViveControllerManager::pluginUpdate(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) { if (!_system) { diff --git a/plugins/openvr/src/ViveControllerManager.h b/plugins/openvr/src/ViveControllerManager.h index 6532540285..0fdd04fdfb 100644 --- a/plugins/openvr/src/ViveControllerManager.h +++ b/plugins/openvr/src/ViveControllerManager.h @@ -41,7 +41,7 @@ public: const QString getName() const override { return NAME; } bool isHandController() const override { return true; } - bool isHeadController() const override { return true; } + bool isHeadController() const override; bool activate() override; void deactivate() override;