diff --git a/Readme.md b/Readme.md index 5588017..827331d 100644 --- a/Readme.md +++ b/Readme.md @@ -22,7 +22,6 @@ > * [Audio Page](#audio_page) > * [Revive Page](#revive_page) > * [Utilities Page](#utilities_page) - > * [Accessibility Page](#accessibility_page) > * [Statistics Page](#statistics_page) > * [Settings Page](#settings_page) > * [How To Compile](#how_to_compile) @@ -260,12 +259,6 @@ Any changes to controller settings are immediately applied by Revive (Requires R - **Steam Desktop Overlay Width:** Allows to increase the size of the Steam desktop overlay. Useful for multi-monitor setups. - **Media Control Keys:** Allows controlling a media player through the media keys. This is the same as having a keyboard with media keys and then pressing them. Should support most common media players. - -## - Accessibility Page: - -![Accessibility Page](docs/screenshots/AccessibilityPage.png) - -- **Adjust Player Height:** Offsets the player height to allows short or wheelchair-bound players to fully interact with height-limited applications by both boosting their height and being able to touch the in-game floor when necessary by pressing a configurable motion controller button. ## - Statistics Page: diff --git a/advancedSettings.pro b/advancedSettings.pro index 8296354..1e54896 100644 --- a/advancedSettings.pro +++ b/advancedSettings.pro @@ -66,7 +66,6 @@ SOURCES += src/main.cpp\ src/tabcontrollers/ReviveTabController.cpp \ src/tabcontrollers/UtilitiesTabController.cpp \ src/tabcontrollers/PttController.cpp \ - src/tabcontrollers/AccessibilityTabController.cpp \ src/utils/ChaperoneUtils.cpp \ src/tabcontrollers/audiomanager/AudioManagerDummy.cpp \ src/tabcontrollers/keyboardinput/KeyboardInputDummy.cpp \ @@ -85,7 +84,6 @@ HEADERS += src/overlaycontroller.h \ src/tabcontrollers/UtilitiesTabController.h \ src/tabcontrollers/AudioManager.h \ src/tabcontrollers/PttController.h \ - src/tabcontrollers/AccessibilityTabController.h \ src/tabcontrollers/KeyboardInput.h \ src/utils/Matrix.h \ src/utils/ChaperoneUtils.h \ @@ -123,7 +121,6 @@ DISTFILES += \ src/res/img/battery/* \ src/res/img/icons/* \ src/res/qml/qmldir \ - src/res/qml/AccessibilityPage.qml \ src/res/qml/audio_page/* \ src/res/qml/ChaperonePage.qml \ src/res/qml/ChaperoneWarningsPage.qml \ diff --git a/docs/screenshots/AccessibilityPage.png b/docs/screenshots/AccessibilityPage.png deleted file mode 100644 index 489d548..0000000 Binary files a/docs/screenshots/AccessibilityPage.png and /dev/null differ diff --git a/src/overlaycontroller.cpp b/src/overlaycontroller.cpp index f75fa09..fbbf18f 100644 --- a/src/overlaycontroller.cpp +++ b/src/overlaycontroller.cpp @@ -129,7 +129,6 @@ OverlayController::OverlayController( bool desktopMode, m_reviveTabController.initStage1( m_settingsTabController.forceRevivePage() ); m_utilitiesTabController.initStage1(); - m_accessibilityTabController.initStage1(); // Set qml context qmlEngine.rootContext()->setContextProperty( "applicationVersion", @@ -248,16 +247,6 @@ OverlayController::OverlayController( bool desktopMode, QQmlEngine::setObjectOwnership( obj, QQmlEngine::CppOwnership ); return obj; } ); - qmlRegisterSingletonType( - "matzman666.advsettings", - 1, - 0, - "AccessibilityTabController", - []( QQmlEngine*, QJSEngine* ) { - QObject* obj = &( objectAddress->m_accessibilityTabController ); - QQmlEngine::setObjectOwnership( obj, QQmlEngine::CppOwnership ); - return obj; - } ); } OverlayController::~OverlayController() @@ -406,7 +395,6 @@ void OverlayController::SetWidget( QQuickItem* quickItem, m_settingsTabController.initStage2( this, m_pWindow.get() ); m_reviveTabController.initStage2( this, m_pWindow.get() ); m_utilitiesTabController.initStage2( this, m_pWindow.get() ); - m_accessibilityTabController.initStage2( this, m_pWindow.get() ); } void OverlayController::OnRenderRequest() @@ -750,8 +738,6 @@ void OverlayController::mainEventLoop() m_settingsTabController.eventLoopTick(); m_reviveTabController.eventLoopTick(); m_audioTabController.eventLoopTick(); - m_accessibilityTabController.eventLoopTick( - vr::VRCompositor()->GetTrackingSpace() ); if ( m_ulOverlayThumbnailHandle != vr::k_ulOverlayHandleInvalid ) { diff --git a/src/overlaycontroller.h b/src/overlaycontroller.h index 8c1b6d4..d06a097 100644 --- a/src/overlaycontroller.h +++ b/src/overlaycontroller.h @@ -37,7 +37,6 @@ #include "tabcontrollers/SettingsTabController.h" #include "tabcontrollers/ReviveTabController.h" #include "tabcontrollers/UtilitiesTabController.h" -#include "tabcontrollers/AccessibilityTabController.h" #include "ivrinput/ivrinput.h" @@ -50,7 +49,6 @@ namespace advsettings // Actual rates of updates are counter * vsync (~11ms) // Values chosen based on update speed priority // Avoid setting values to the same numbers. -constexpr int k_accessibilitySettingsUpdateCounter = 151; constexpr int k_audioSettingsUpdateCounter = 89; constexpr int k_chaperoneSettingsUpdateCounter = 101; constexpr int k_moveCenterSettingsUpdateCounter = 149; @@ -121,7 +119,6 @@ public: // I know it's an ugly hack to make them public to enable external SettingsTabController m_settingsTabController; ReviveTabController m_reviveTabController; UtilitiesTabController m_utilitiesTabController; - AccessibilityTabController m_accessibilityTabController; private: QPoint getMousePositionForEvent( vr::VREvent_Mouse_t mouse ); diff --git a/src/res/qml/AccessibilityPage.qml b/src/res/qml/AccessibilityPage.qml deleted file mode 100644 index 0a458eb..0000000 --- a/src/res/qml/AccessibilityPage.qml +++ /dev/null @@ -1,187 +0,0 @@ -import QtQuick 2.7 -import QtQuick.Controls 2.0 -import QtQuick.Layouts 1.3 -import matzman666.advsettings 1.0 -import "common" - - -MyStackViewPage { - headerText: "Accessibility Tools" - - PttControllerConfigDialog { - id: pttControllerConfigDialog - pttControllerConfigClass: AccessibilityTabController - } - - content: ColumnLayout { - spacing: 92 - - GroupBox { - Layout.fillWidth: true - - label: MyText { - leftPadding: 10 - text: "Adjust Player Height" - bottomPadding: -10 - } - background: Rectangle { - color: "transparent" - border.color: "#ffffff" - radius: 8 - } - - ColumnLayout { - anchors.fill: parent - - Rectangle { - color: "#ffffff" - height: 1 - Layout.fillWidth: true - Layout.bottomMargin: 5 - } - - RowLayout { - MyPushButton2 { - Layout.preferredWidth: 40 - text: "-" - onClicked: { - accessibilityMoveYSlider.value -= 0.05 - } - } - - MySlider { - id: accessibilityMoveYSlider - from: 0 - to: 1.5 - stepSize: 0.01 - value: 0.0 - Layout.fillWidth: true - onPositionChanged: { - var val = this.from + ( this.position * (this.to - this.from)) - accessibilityMoveYText.text = val.toFixed(2) - } - onValueChanged: { - AccessibilityTabController.heightOffset = this.value.toFixed(2) - } - } - - MyPushButton2 { - Layout.preferredWidth: 40 - text: "+" - onClicked: { - accessibilityMoveYSlider.value += 0.05 - } - } - - MyTextField { - id: accessibilityMoveYText - text: "0.00" - keyBoardUID: 700 - Layout.preferredWidth: 140 - Layout.leftMargin: 10 - Layout.rightMargin: 10 - horizontalAlignment: Text.AlignHCenter - function onInputEvent(input) { - var val = parseFloat(input) - if (!isNaN(val)) { - if (val >= accessibilityMoveYSlider.from && val <= accessibilityMoveYSlider.to) { - accessibilityMoveYSlider.value = val.toFixed(2); - } else { - AccessibilityTabController.setHeightOffset(val.toFixed(2), false); - } - } - text = AccessibilityTabController.heightOffset.toFixed(2) - } - } - } - - RowLayout { - MyToggleButton { - id: heightOffsetPttEnabledToggle - Layout.preferredWidth: 260 - text: "Push-to-Toggle:" - onClicked: { - AccessibilityTabController.pttEnabled = checked - } - } - MyToggleButton { - id: heightOffsetPttLeftControllerToggle - text: "Left Controller" - onClicked: { - AccessibilityTabController.setPttLeftControllerEnabled(checked, false) - } - } - MyPushButton { - text: "Configure" - onClicked: { - pttControllerConfigDialog.openPopup(0) - } - } - Item { - Layout.fillWidth: true - } - MyToggleButton { - id: heightOffsetPttRightControllerToggle - text: "Right Controller" - onClicked: { - AccessibilityTabController.setPttRightControllerEnabled(checked, false) - } - } - MyPushButton { - text: "Configure" - onClicked: { - pttControllerConfigDialog.openPopup(1) - } - } - } - } - } - - Item { Layout.fillHeight: true; Layout.fillWidth: true} - - MyPushButton { - id: accessibilityResetButton - Layout.preferredWidth: 250 - text: "Reset" - onClicked: { - AccessibilityTabController.reset() - } - } - - Component.onCompleted: { - var heightOffsetFormatted = AccessibilityTabController.heightOffset.toFixed(2) - if (heightOffsetFormatted >= accessibilityMoveYSlider.from && heightOffsetFormatted <= accessibilityMoveYSlider.to) { - accessibilityMoveYSlider.value = heightOffsetFormatted - } - accessibilityMoveYText.text = heightOffsetFormatted - heightOffsetPttEnabledToggle.checked = AccessibilityTabController.pttEnabled - heightOffsetPttLeftControllerToggle.checked = AccessibilityTabController.pttLeftControllerEnabled - heightOffsetPttRightControllerToggle.checked = AccessibilityTabController.pttRightControllerEnabled - } - - Connections { - target: AccessibilityTabController - onHeightOffsetChanged: { - var heightOffsetFormatted = AccessibilityTabController.heightOffset.toFixed(2) - if (heightOffsetFormatted >= accessibilityMoveYSlider.from && heightOffsetFormatted <= accessibilityMoveYSlider.to) { - accessibilityMoveYSlider.value = heightOffsetFormatted - } - accessibilityMoveYText.text = heightOffsetFormatted - } - onPttEnabledChanged: { - heightOffsetPttEnabledToggle.checked = AccessibilityTabController.pttEnabled - } - onPttActiveChanged: { - - } - onPttLeftControllerEnabledChanged: { - heightOffsetPttLeftControllerToggle.checked = AccessibilityTabController.pttLeftControllerEnabled - } - onPttRightControllerEnabledChanged: { - heightOffsetPttRightControllerToggle.checked = AccessibilityTabController.pttRightControllerEnabled - } - } - - } - -} diff --git a/src/res/qml/RootPage.qml b/src/res/qml/RootPage.qml index 8f59a1b..bfb9bae 100644 --- a/src/res/qml/RootPage.qml +++ b/src/res/qml/RootPage.qml @@ -103,17 +103,6 @@ MyStackViewPage { } } - MyPushButton { - id: accessibilityButton - activationSoundEnabled: false - text: "Accessibility" - Layout.fillWidth: true - onClicked: { - MyResources.playFocusChangedSound() - mainView.push(accessibilityPage) - } - } - MyPushButton { id: statisticsButton activationSoundEnabled: false diff --git a/src/res/qml/common/mainwidget.qml b/src/res/qml/common/mainwidget.qml index 3853a84..7c763f5 100644 --- a/src/res/qml/common/mainwidget.qml +++ b/src/res/qml/common/mainwidget.qml @@ -65,11 +65,6 @@ Rectangle { visible: false } - property AccessibilityPage accessibilityPage: AccessibilityPage { - stackView: mainView - visible: false - } - StackView { id: mainView anchors.fill: parent diff --git a/src/tabcontrollers/AccessibilityTabController.cpp b/src/tabcontrollers/AccessibilityTabController.cpp deleted file mode 100644 index d135fee..0000000 --- a/src/tabcontrollers/AccessibilityTabController.cpp +++ /dev/null @@ -1,136 +0,0 @@ -#include "AccessibilityTabController.h" -#include -#include "../overlaycontroller.h" - -// application namespace -namespace advsettings -{ -void AccessibilityTabController::initStage1() -{ - setTrackingUniverse( vr::VRCompositor()->GetTrackingSpace() ); - auto settings = OverlayController::appSettings(); - settings->beginGroup( getSettingsName() ); - auto value = settings->value( "heightOffset", m_heightOffset ); - settings->endGroup(); - if ( value.isValid() && !value.isNull() ) - { - m_heightOffset = value.toFloat(); - emit heightOffsetChanged( m_heightOffset ); - } - - reloadPttConfig(); -} - -void AccessibilityTabController::initStage2( OverlayController* var_parent, - QQuickWindow* var_widget ) -{ - this->parent = var_parent; - this->widget = var_widget; -} - -void AccessibilityTabController::setTrackingUniverse( int value ) -{ - if ( m_trackingUniverse != value ) - { - reset(); - m_trackingUniverse = value; - } -} - -float AccessibilityTabController::heightOffset() const -{ - return m_heightOffset; -} - -void AccessibilityTabController::setHeightOffset( float value, bool notify ) -{ - if ( std::abs( m_heightOffset - value ) > 0.001 ) - { - modHeightOffset( value - m_heightOffset, notify ); - } -} - -void AccessibilityTabController::modHeightOffset( float value, bool notify ) -{ - parent->AddOffsetToUniverseCenter( - ( vr::TrackingUniverseOrigin ) m_trackingUniverse, 1, -value, false ); - m_heightOffset += value; - auto settings = OverlayController::appSettings(); - settings->beginGroup( getSettingsName() ); - settings->setValue( "heightOffset", m_heightOffset ); - settings->endGroup(); - settings->sync(); - if ( notify ) - { - emit heightOffsetChanged( m_heightOffset ); - } -} - -void AccessibilityTabController::onPttStart() -{ - m_toggleHeightOffset = m_heightOffset; - parent->AddOffsetToUniverseCenter( - ( vr::TrackingUniverseOrigin ) m_trackingUniverse, - 1, - m_toggleHeightOffset, - false ); -} - -void AccessibilityTabController::onPttStop() -{ - parent->AddOffsetToUniverseCenter( - ( vr::TrackingUniverseOrigin ) m_trackingUniverse, - 1, - -m_toggleHeightOffset, - false ); -} - -void AccessibilityTabController::onPttDisabled() -{ - if ( pttActive() ) - { - stopPtt(); - } - m_toggleHeightOffset = 0; -} - -void AccessibilityTabController::reset() -{ - std::lock_guard lock( eventLoopMutex ); - vr::VRChaperoneSetup()->RevertWorkingCopy(); - parent->AddOffsetToUniverseCenter( - ( vr::TrackingUniverseOrigin ) m_trackingUniverse, - 1, - m_heightOffset, - false, - false ); - vr::VRChaperoneSetup()->CommitWorkingCopy( vr::EChaperoneConfigFile_Live ); - m_heightOffset = 0.0f; - emit heightOffsetChanged( m_heightOffset ); -} - -void AccessibilityTabController::eventLoopTick( - vr::ETrackingUniverseOrigin universe ) -{ - if ( !eventLoopMutex.try_lock() ) - { - return; - } - - if ( settingsUpdateCounter >= k_accessibilitySettingsUpdateCounter ) - { - if ( parent->isDashboardVisible() ) - { - setTrackingUniverse( ( int ) universe ); - } - settingsUpdateCounter = 0; - } - else - { - settingsUpdateCounter++; - } - checkPttStatus(); - eventLoopMutex.unlock(); -} - -} // namespace advsettings diff --git a/src/tabcontrollers/AccessibilityTabController.h b/src/tabcontrollers/AccessibilityTabController.h deleted file mode 100644 index 65de4d2..0000000 --- a/src/tabcontrollers/AccessibilityTabController.h +++ /dev/null @@ -1,54 +0,0 @@ - -#pragma once - -#include "PttController.h" - -class QQuickWindow; -// application namespace -namespace advsettings -{ -// forward declaration -class OverlayController; - -class AccessibilityTabController : public PttController -{ - Q_OBJECT - Q_PROPERTY( float heightOffset READ heightOffset WRITE setHeightOffset - NOTIFY heightOffsetChanged ) - -private: - OverlayController* parent; - QQuickWindow* widget; - - int m_trackingUniverse = ( int ) vr::TrackingUniverseStanding; - float m_heightOffset = 0.0f; - float m_toggleHeightOffset = 0.0f; - - unsigned settingsUpdateCounter = 0; - - QString getSettingsName() override - { - return "accessibilitySettings"; - } - void onPttStart() override; - void onPttStop() override; - void onPttDisabled() override; - -public: - void initStage1(); - void initStage2( OverlayController* parent, QQuickWindow* widget ); - void eventLoopTick( vr::ETrackingUniverseOrigin universe ); - - float heightOffset() const; - -public slots: - void setTrackingUniverse( int value ); - void setHeightOffset( float value, bool notify = true ); - void modHeightOffset( float value, bool notify = true ); - void reset(); - -signals: - void heightOffsetChanged( float value ); -}; - -} // namespace advsettings