Add optional toggle of the Y offset to MoveCenterTabController. Allows short players and wheelchair users to fully interact with height-limited applications by both boosting their height and being able to touch the in-game floor when necessary.

This commit is contained in:
Mel Klimushyn
2017-01-28 10:39:24 -08:00
parent 6c7240fcf6
commit 39f81f39ab
3 changed files with 528 additions and 13 deletions
@@ -1,8 +1,11 @@
#pragma once
#include "AudioTabController.h"
#include <QObject>
#include <QVariant>
#include <openvr.h>
#include <mutex>
class QQuickWindow;
// application namespace
@@ -20,20 +23,36 @@ class MoveCenterTabController : public QObject {
Q_PROPERTY(float offsetZ READ offsetZ WRITE setOffsetZ NOTIFY offsetZChanged)
Q_PROPERTY(int rotation READ rotation WRITE setRotation NOTIFY rotationChanged)
Q_PROPERTY(bool adjustChaperone READ adjustChaperone WRITE setAdjustChaperone NOTIFY adjustChaperoneChanged)
Q_PROPERTY(bool pttEnabled READ pttEnabled WRITE setPttEnabled NOTIFY pttEnabledChanged)
Q_PROPERTY(bool pttActive READ pttActive NOTIFY pttActiveChanged)
Q_PROPERTY(bool pttLeftControllerEnabled READ pttLeftControllerEnabled WRITE setPttLeftControllerEnabled NOTIFY pttLeftControllerEnabledChanged)
Q_PROPERTY(bool pttRightControllerEnabled READ pttRightControllerEnabled WRITE setPttRightControllerEnabled NOTIFY pttRightControllerEnabledChanged)
private:
void offsetYToggle(bool enabled);
OverlayController* parent;
QQuickWindow* widget;
int m_trackingUniverse = (int)vr::TrackingUniverseStanding;
float m_offsetX = 0.0f;
float m_offsetY = 0.0f;
float m_toggleOffsetY = 0.0f;
float m_offsetZ = 0.0f;
int m_rotation = 0;
bool m_adjustChaperone = true;
bool m_pttEnabled = false;
bool m_pttActive = false;
bool m_pttShowNotification = false;
bool m_pttLeftControllerEnabled = false;
bool m_pttRightControllerEnabled = false;
PttControllerConfig m_pttControllerConfigs[2];
unsigned settingsUpdateCounter = 0;
std::recursive_mutex eventLoopMutex;
public:
void initStage1();
void initStage2(OverlayController* parent, QQuickWindow* widget);
@@ -46,6 +65,19 @@ public:
int rotation() const;
bool adjustChaperone() const;
bool pttEnabled() const;
bool pttActive() const;
bool pttLeftControllerEnabled() const;
bool pttRightControllerEnabled() const;
void reloadPttConfig();
void savePttConfig();
Q_INVOKABLE QVariantList pttDigitalButtons(unsigned controller);
Q_INVOKABLE unsigned long pttDigitalButtonMask(unsigned controller);
Q_INVOKABLE unsigned pttTouchpadMode(unsigned controller);
Q_INVOKABLE unsigned pttTriggerMode(unsigned controller);
Q_INVOKABLE unsigned pttTouchpadArea(unsigned controller);
public slots:
int trackingUniverse() const;
void setTrackingUniverse(int value, bool notify = true);
@@ -63,6 +95,12 @@ public slots:
void modOffsetZ(float value, bool notify = true);
void reset();
void setPttEnabled(bool value, bool notify = true, bool save = true);
void setPttLeftControllerEnabled(bool value, bool notify = true, bool save = true);
void setPttRightControllerEnabled(bool value, bool notify = true, bool save = true);
void setPttControllerConfig(unsigned controller, QVariantList buttons, unsigned triggerMode, unsigned padMode, unsigned padAreas);
signals:
void trackingUniverseChanged(int value);
void offsetXChanged(float value);
@@ -70,6 +108,11 @@ signals:
void offsetZChanged(float value);
void rotationChanged(int value);
void adjustChaperoneChanged(bool value);
void pttEnabledChanged(bool value);
void pttActiveChanged(bool value);
void pttLeftControllerEnabledChanged(bool value);
void pttRightControllerEnabledChanged(bool value);
};
} // namespace advsettings