Keyboard Parse Fix (#467)

* fixed input sending bug not properly releasing keys

* updated to ovr 1.12.5

* added disable oculus api button experimental

* small refactor and fix float and bool bugs
This commit is contained in:
ykeara
2020-06-05 15:42:10 -05:00
committed by GitHub
parent 4757756d32
commit 82a0357748
21 changed files with 1297 additions and 161 deletions
+10 -2
View File
@@ -30,10 +30,14 @@ inline void sendTokensAsInput( const std::vector<Token> tokens )
if ( isModifier( token ) )
{
sendKeyPress( token, KeyStatus::Down );
if ( !noKeyUp )
if ( noKeyUp )
{
heldInputs.push_back( token );
}
else
{
sendKeyPress( token, KeyStatus::Up );
}
continue;
}
@@ -50,7 +54,11 @@ inline void sendTokensAsInput( const std::vector<Token> tokens )
if ( isLiteral( token ) )
{
sendKeyPress( token, KeyStatus::Down );
if ( !noKeyUp )
if ( noKeyUp )
{
heldInputs.push_back( token );
}
else
{
sendKeyPress( token, KeyStatus::Up );
}
+11
View File
@@ -80,6 +80,13 @@ MyStackViewPage {
SettingsTabController.setNativeChaperoneToggle(this.checked, true)
}
}
MyToggleButton {
id: oculusSdkToggleButton
text: "Force Use SteamVR (Disable Oculus API [experimental])"
onCheckedChanged: {
SettingsTabController.setOculusSdkToggle(this.checked, true)
}
}
RowLayout {
Layout.fillWidth: true
@@ -238,6 +245,7 @@ MyStackViewPage {
debugStateText.text = OverlayController.debugState
disableVersionCheckToggle.checked = OverlayController.disableVersionCheck
nativeChaperoneToggleButton.checked = SettingsTabController.nativeChaperoneToggle
oculusSdkToggleButton.checked = SettingsTabController.oculusSdkToggle
seatedOldExternalWarning.visible = MoveCenterTabController.allowExternalEdits && MoveCenterTabController.oldStyleMotion && MoveCenterTabController.enableSeatedMotion
}
@@ -250,6 +258,9 @@ MyStackViewPage {
onNativeChaperoneToggleChanged:{
nativeChaperoneToggleButton.checked = SettingsTabController.nativeChaperoneToggle
}
onOculusSdkToggleChanged:{
oculusSdkToggleButton.checked = SettingsTabController.oculusSdkToggle
}
}
Connections {
+40 -11
View File
@@ -17,6 +17,7 @@ void SettingsTabController::initStage2( OverlayController* var_parent )
{
this->parent = var_parent;
setNativeChaperoneToggle( nativeChaperoneToggle() );
setOculusSdkToggle( oculusSdkToggle() );
}
void SettingsTabController::dashboardLoopTick()
@@ -40,32 +41,60 @@ bool SettingsTabController::autoStartEnabled() const
bool SettingsTabController::nativeChaperoneToggle()
{
std::pair<ovr_settings_wrapper::SettingsError, bool> p
= ovr_settings_wrapper::getFloat(
vr::k_pch_CollisionBounds_Section,
vr::k_pch_CollisionBounds_EnableDriverImport,
"" );
auto p = ovr_settings_wrapper::getBool(
vr::k_pch_CollisionBounds_Section,
vr::k_pch_CollisionBounds_EnableDriverImport,
"" );
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
{
m_nativeChaperoneToggle = !( p.second );
return !( p.second );
}
return m_nativeChaperoneToggle;
return false;
}
bool SettingsTabController::oculusSdkToggle()
{
auto p = ovr_settings_wrapper::getBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_BlockOculusSDKOnAllLaunches_Bool,
"" );
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
{
return ( p.second );
}
return false;
}
void SettingsTabController::setNativeChaperoneToggle( bool value, bool notify )
{
if ( m_nativeChaperoneToggle != value )
if ( nativeChaperoneToggle() != value )
{
m_nativeChaperoneToggle = !( value );
ovr_settings_wrapper::setBool(
vr::k_pch_CollisionBounds_Section,
vr::k_pch_CollisionBounds_EnableDriverImport,
m_nativeChaperoneToggle,
!value,
"" );
// On Error Do Nothing
if ( notify )
{
emit nativeChaperoneToggleChanged( m_nativeChaperoneToggle );
emit nativeChaperoneToggleChanged( !value );
}
}
}
void SettingsTabController::setOculusSdkToggle( bool value, bool notify )
{
if ( oculusSdkToggle() != value )
{
ovr_settings_wrapper::setBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_BlockOculusSDKOnAllLaunches_Bool,
value,
"" );
// On Error Do Nothing
if ( notify )
{
emit oculusSdkToggleChanged( value );
}
}
}
@@ -20,6 +20,8 @@ class SettingsTabController : public QObject
Q_PROPERTY(
bool nativeChaperoneToggle READ nativeChaperoneToggle WRITE
setNativeChaperoneToggle NOTIFY nativeChaperoneToggleChanged )
Q_PROPERTY( bool oculusSdkToggle READ oculusSdkToggle WRITE
setOculusSdkToggle NOTIFY oculusSdkToggleChanged )
private:
OverlayController* parent;
@@ -39,14 +41,17 @@ public:
bool autoStartEnabled() const;
bool nativeChaperoneToggle();
bool oculusSdkToggle();
public slots:
void setAutoStartEnabled( bool value, bool notify = true );
void setNativeChaperoneToggle( bool value, bool notify = true );
void setOculusSdkToggle( bool value, bool notify = true );
signals:
void autoStartEnabledChanged( bool value );
void nativeChaperoneToggleChanged( bool value );
void oculusSdkToggleChanged( bool value );
};
} // namespace advsettings