add slider for LH_STICK_DEADZONE
This commit is contained in:
@@ -132,6 +132,26 @@ Kirigami.ScrollablePage {
|
||||
toolTipText: i18n("Allows the use of lighthouse-based controllers and trackers.\nRequires SteamVR to be installed.\nDevices must be be powered on before connecting to WiVRn.\nAn external tool such as motoc is needed for calibration.")
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
visible: Settings.steamvr_lh_supported && steamvr_lh.checked
|
||||
Kirigami.FormData.label: i18n("SteamVR joystick deadzone")
|
||||
Controls.Slider {
|
||||
id: lh_stick_deadzone
|
||||
Layout.fillWidth: true
|
||||
from: 0.0
|
||||
to: 0.9
|
||||
stepSize: 0.05
|
||||
value: Settings.lhStickDeadzone
|
||||
}
|
||||
Controls.Label {
|
||||
text: lh_stick_deadzone.value.toFixed(2)
|
||||
Layout.preferredWidth: 35
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
Kirigami.ContextualHelpButton {
|
||||
toolTipText: i18n("Deadzone to apply to joysticks on lighthouse-tracked controllers, such as Index.\nFor standalone controllers, deadzones may be adjusted via the headset's system settings.")
|
||||
}
|
||||
}
|
||||
|
||||
Controls.CheckBox {
|
||||
id: adb_custom
|
||||
@@ -289,6 +309,7 @@ Kirigami.ScrollablePage {
|
||||
|
||||
Settings.debugGui = debug_gui.checked;
|
||||
Settings.steamVrLh = steamvr_lh.checked;
|
||||
Settings.lhStickDeadzone = lh_stick_deadzone.value;
|
||||
Settings.hidForwarding = hid_forwarding.checked;
|
||||
|
||||
DashboardSettings.auto_connect_usb = auto_connect_usb.checked;
|
||||
@@ -298,6 +319,7 @@ Kirigami.ScrollablePage {
|
||||
select_game.load();
|
||||
debug_gui.checked = Settings.debugGui;
|
||||
steamvr_lh.checked = Settings.steamVrLh;
|
||||
lh_stick_deadzone.value = Settings.lhStickDeadzone;
|
||||
hid_forwarding.checked = Settings.hidForwarding;
|
||||
|
||||
auto_connect_usb.checked = DashboardSettings.auto_connect_usb;
|
||||
|
||||
@@ -121,6 +121,7 @@ void Settings::emitAllChanged()
|
||||
openvrChanged();
|
||||
debugGuiChanged();
|
||||
steamVrLhChanged();
|
||||
lhStickDeadzoneChanged();
|
||||
hidForwardingChanged();
|
||||
portChanged();
|
||||
hostnameChanged();
|
||||
@@ -416,6 +417,22 @@ void Settings::set_steamVrLh(const bool & value)
|
||||
steamVrLhChanged();
|
||||
}
|
||||
|
||||
float Settings::lhStickDeadzone() const
|
||||
{
|
||||
auto it = m_jsonSettings.find("lh-stick-deadzone");
|
||||
if (it != m_jsonSettings.end() and it->is_number())
|
||||
return static_cast<float>(*it);
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void Settings::set_lhStickDeadzone(const float & value)
|
||||
{
|
||||
auto old = lhStickDeadzone();
|
||||
m_jsonSettings["lh-stick-deadzone"] = value;
|
||||
if (old != value)
|
||||
lhStickDeadzoneChanged();
|
||||
}
|
||||
|
||||
bool Settings::tcpOnly() const
|
||||
{
|
||||
auto it = m_jsonSettings.find("tcp-only");
|
||||
@@ -539,6 +556,7 @@ void Settings::restore_defaults()
|
||||
m_jsonSettings.erase("hid-forwarding");
|
||||
m_jsonSettings.erase("debug-gui");
|
||||
m_jsonSettings.erase("use-steamvr-lh");
|
||||
m_jsonSettings.erase("lh-stick-deadzone");
|
||||
m_jsonSettings.erase("tcp-only");
|
||||
m_jsonSettings.erase("application");
|
||||
m_jsonSettings.erase("port");
|
||||
|
||||
@@ -76,6 +76,7 @@ public:
|
||||
Q_PROPERTY(bool hidForwarding READ hidForwarding WRITE set_hidForwarding NOTIFY hidForwardingChanged)
|
||||
Q_PROPERTY(bool debugGui READ debugGui WRITE set_debugGui NOTIFY debugGuiChanged)
|
||||
Q_PROPERTY(bool steamVrLh READ steamVrLh WRITE set_steamVrLh NOTIFY steamVrLhChanged)
|
||||
Q_PROPERTY(float lhStickDeadzone READ lhStickDeadzone WRITE set_lhStickDeadzone NOTIFY lhStickDeadzoneChanged)
|
||||
|
||||
Q_PROPERTY(bool flatpak READ flatpak CONSTANT)
|
||||
Q_PROPERTY(int default_port READ default_port CONSTANT)
|
||||
@@ -91,6 +92,7 @@ public:
|
||||
SETTER_GETTER_NOTIFY(bool, hidForwarding)
|
||||
SETTER_GETTER_NOTIFY(bool, debugGui)
|
||||
SETTER_GETTER_NOTIFY(bool, steamVrLh)
|
||||
SETTER_GETTER_NOTIFY(float, lhStickDeadzone)
|
||||
SETTER_GETTER_NOTIFY(bool, tcpOnly)
|
||||
SETTER_GETTER_NOTIFY(int, port)
|
||||
SETTER_GETTER_NOTIFY(QString, hostname)
|
||||
|
||||
Reference in New Issue
Block a user