fixes keyboard positioning (#394)
This commit is contained in:
+11
-18
@@ -1408,25 +1408,18 @@ void OverlayController::showKeyboard( QString existingText,
|
||||
1024,
|
||||
existingText.toStdString().c_str(),
|
||||
userValue );
|
||||
setKeyboardPos();
|
||||
}
|
||||
|
||||
auto m_trackingUniverse = vr::VRCompositor()->GetTrackingSpace();
|
||||
|
||||
vr::EVROverlayError overlayerror;
|
||||
// System Overlay Key
|
||||
const auto systemOverlayKey = std::string( "system.systemui" );
|
||||
vr::VROverlayHandle_t systemOverlayHandle;
|
||||
overlayerror = vr::VROverlay()->FindOverlay( systemOverlayKey.c_str(),
|
||||
&systemOverlayHandle );
|
||||
if ( overlayerror != vr::VROverlayError_None )
|
||||
{
|
||||
return;
|
||||
}
|
||||
vr::HmdMatrix34_t overlayPos;
|
||||
vr::VROverlay()->GetOverlayTransformAbsolute(
|
||||
systemOverlayHandle, &m_trackingUniverse, &overlayPos );
|
||||
overlayPos.m[1][3] = overlayPos.m[1][3] - 1.0f;
|
||||
vr::VROverlay()->SetKeyboardTransformAbsolute( m_trackingUniverse,
|
||||
&overlayPos );
|
||||
void OverlayController::setKeyboardPos()
|
||||
{
|
||||
vr::HmdVector2_t emptyvec;
|
||||
emptyvec.v[0] = 0;
|
||||
emptyvec.v[1] = 0;
|
||||
vr::HmdRect2_t empty;
|
||||
empty.vTopLeft = emptyvec;
|
||||
empty.vBottomRight = emptyvec;
|
||||
vr::VROverlay()->SetKeyboardPositionForOverlay( m_ulOverlayHandle, empty );
|
||||
}
|
||||
|
||||
void OverlayController::playActivationSound()
|
||||
|
||||
@@ -252,6 +252,7 @@ public slots:
|
||||
void OnNetworkReply( QNetworkReply* reply );
|
||||
|
||||
void showKeyboard( QString existingText, unsigned long userValue = 0 );
|
||||
void setKeyboardPos();
|
||||
|
||||
void playActivationSound();
|
||||
void playFocusChangedSound();
|
||||
|
||||
Reference in New Issue
Block a user