Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 8 additions & 18 deletions interface/resources/qml/hifi/tablet/ControllerSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Created by Dante Ruiz on 6/1/17.
// Copyright 2017 High Fidelity, Inc.
// Copyright 2020 Vircadia contributors.
// Copyright 2025 Overte e.V.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
Expand All @@ -27,7 +28,6 @@ Item {
width: parent.width

property string title: "Controls"
property var openVRDevices: ["HTC Vive", "Valve Index", "Valve HMD", "Valve", "WindowsMR", "Oculus"]

HifiConstants { id: hifi }

Expand Down Expand Up @@ -166,7 +166,7 @@ Item {
anchors.leftMargin: 40
spacing: 10
HifiControls.ComboBox {
id: box
id: comboBox
width: 160
z: 999
editable: true
Expand All @@ -185,7 +185,7 @@ Item {
text: "Show all input devices"

onClicked: {
box.model = inputPlugins();
comboBox.model = inputPlugins();
changeSource();
}
}
Expand Down Expand Up @@ -242,18 +242,8 @@ Item {
id: loader
asynchronous: false
anchors.fill: parent
source: InputConfiguration.configurationLayout(box.textAt(box.currentIndex));
source: InputConfiguration.configurationLayout(comboBox.textAt(comboBox.currentIndex));
onLoaded: {
if (loader.item.hasOwnProperty("pluginName")) {
if (openVRDevices.indexOf(box.textAt(box.currentIndex)) !== -1) {
loader.item.pluginName = "OpenVR";
} else if (box.currentIndex.startsWith("OpenXR")) {
loader.item.pluginName = "OpenXR";
} else {
loader.item.pluginName = box.textAt(box.currentIndex);
}
}

if (loader.item.hasOwnProperty("displayInformation")) {
loader.item.displayConfiguration();
}
Expand Down Expand Up @@ -299,9 +289,9 @@ Item {

function changeSource() {
loader.source = "";
var selectedDevice = box.textAt(box.currentIndex);
var selectedDevice = comboBox.textAt(comboBox.currentIndex);
var source = "";
if (openVRDevices.indexOf(selectedDevice) !== -1) {
if (selectedDevice.startsWith("OpenVR")) {
source = InputConfiguration.configurationLayout("OpenVR");
} else if (selectedDevice.startsWith("OpenXR")) {
source = InputConfiguration.configurationLayout("OpenXR");
Expand All @@ -311,9 +301,9 @@ Item {

loader.source = source;
if (source === "") {
box.label = "(not configurable)";
comboBox.label = "(not configurable)";
} else {
box.label = "";
comboBox.label = "";
}

stack.selectedPlugin = selectedDevice;
Expand Down
14 changes: 2 additions & 12 deletions libraries/plugins/src/plugins/InputConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ QStringList InputConfiguration::inputPlugins() {
QStringList inputPlugins;
for (const auto& plugin : PluginManager::getInstance()->getInputPlugins()) {
QString pluginName = plugin->getName();
if (pluginName == QString("OpenVR")) {
QString headsetName = plugin->getDeviceName();
inputPlugins << headsetName;
} else {
inputPlugins << pluginName;
}
inputPlugins << pluginName;
}
return inputPlugins;
}
Expand All @@ -54,12 +49,7 @@ QStringList InputConfiguration::activeInputPlugins() {
for (const auto& plugin : PluginManager::getInstance()->getInputPlugins()) {
if (plugin->configurable()) {
QString pluginName = plugin->getName();
if (pluginName == QString("OpenVR")) {
QString headsetName = plugin->getDeviceName();
activePlugins << headsetName;
} else {
activePlugins << pluginName;
}
activePlugins << pluginName;
}
}
return activePlugins;
Expand Down
5 changes: 3 additions & 2 deletions plugins/openvr/src/OpenVrDisplayPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Created by Bradley Austin Davis on 2015/05/12
// Copyright 2015 High Fidelity, Inc.
// Copyright 2020 Vircadia contributors.
// Copyright 2025 Overte e.V.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
Expand Down Expand Up @@ -409,8 +410,8 @@ void OpenVrDisplayPlugin::init() {
}

const QString OpenVrDisplayPlugin::getName() const {
std::string headsetName = getOpenVrDeviceName();
if (headsetName == "HTC") {
std::string headsetName = "OpenVR: " + getOpenVrDeviceName();
if (getOpenVrDeviceName() == "HTC") {
headsetName += " Vive";
}

Expand Down
Loading