Skip to content
Snippets Groups Projects
Commit 5ece5f18 authored by sdegrande's avatar sdegrande
Browse files

dominant-hand json property: use 'left'/'right' instead of 0/1

This is more human-friendly...
parent 598ee08c
No related branches found
No related tags found
No related merge requests found
......@@ -385,7 +385,7 @@
},
"interaction-set" : {
"dominant-hand" : 0
"dominant-hand" : "right"
},
"hardware-set" : {
......
// SPDX-FileCopyrightText: Copyright (c) 2020-2024 CRIStAL/PIRVI. All rights reserved.
// SPDX-FileCopyrightText: Copyright (c) 2020-2024 Samuel Degrande
// SPDX-FileCopyrightText: Copyright (c) 2020-2025 CRIStAL/PIRVI. All rights reserved.
// SPDX-FileCopyrightText: Copyright (c) 2020-2025 Samuel Degrande
// SPDX-License-Identifier: BSD-3-Clause
/**
......@@ -39,8 +39,8 @@ VAirDrawLauncher::VAirDrawLauncher(wxWindow* parent, wxWindowID winid) : ILaunch
choices, 0, wxRA_SPECIFY_COLS);
wxString hands[] = { "Left hand", "Right hand" };
dominantHandBox = new wxRadioBox(this, wxID_ANY, "Dominant hand", wxDefaultPosition, wxDefaultSize, 2,
hands, 0, wxRA_SPECIFY_COLS);
dominantHandBox = new wxRadioBox(this, wxID_ANY, "Dominant hand", wxDefaultPosition, wxDefaultSize, 2, hands, 0,
wxRA_SPECIFY_COLS);
saveCaptureButton->Hide();
launchExternalButton->Hide();
......@@ -251,7 +251,7 @@ void VAirDrawLauncher::onWriteAppConfig(DispatchAppConfigData* appConfig)
ItemsMap options = getItems();
int dominantHand = options["dominant-hand"].GetLong();
appConfig->jsonRoot["interaction-set"]["dominant-hand"] = dominantHand;
appConfig->jsonRoot["interaction-set"]["dominant-hand"] = (dominantHand == 0) ? "left" : "right";
if (appConfig->runMode == LauncherConfig::MASTER) {
Json::Value& collabConfig = appConfig->jsonRoot["core"]["collaboration"]["collab-master"];
......
// SPDX-FileCopyrightText: Copyright (c) 2020-2023 CRIStAL/PIRVI. All rights reserved.
// SPDX-FileCopyrightText: Copyright (c) 2020-2023 Samuel Degrande
// SPDX-FileCopyrightText: Copyright (c) 2020-2025 CRIStAL/PIRVI. All rights reserved.
// SPDX-FileCopyrightText: Copyright (c) 2020-2025 Samuel Degrande
// SPDX-License-Identifier: BSD-3-Clause
/**
......@@ -166,7 +166,8 @@ bool SlaveProcess::setSlaveConfig(const std::string& data)
parseJson(data, jsContent);
jsContent["core"]["local-asset-dir"] = Setup::getInstance()->ReadString("default-local-asset").ToStdString();
jsContent["interaction-set"]["dominant-hand"] = static_cast<int>(options["dominant-hand"].GetLong());
int dominantHand = static_cast<int>(options["dominant-hand"].GetLong());
jsContent["interaction-set"]["dominant-hand"] = (dominantHand == 0) ? "left" : "right";
configFile.Write(jsContent.toStyledString());
configFile.Close();
......
......@@ -109,7 +109,7 @@ bool OpenXRInput::initialize(OxrConnection& oxrConn, const std::string& manifest
// First check if the 'default-action-set' prefix exists. If so, it means that this action set is not 'handed'.
// If not found, look for the 'handed' action set.
oxrControllers.primaryIsLeft = (interactionConf["dominant-hand"].asInt() == 0);
oxrControllers.primaryIsLeft = (interactionConf["dominant-hand"].asString() == "left");
auto it = oxrActionSets.find(defaultActionSetName);
if (it == oxrActionSets.end()) {
std::string handedActionSetName =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment