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