Move push to talk bindings to overlaycontroller

The old system used the old OpenVR input system which is
incompatible with the new IVRInput.

This change broke the AccessbilityTabController, but
that is to be removed because the functionality can be
found elsewhere.
This commit is contained in:
Vitaly
2019-02-16 15:11:32 +01:00
committed by Vasily
parent 28cf033bec
commit 3c59a2b2ae
5 changed files with 52 additions and 125 deletions
+38 -8
View File
@@ -464,14 +464,7 @@ QPoint OverlayController::getMousePositionForEvent( vr::VREvent_Mouse_t mouse )
return QPoint( mouse.x, y );
}
/*!
Checks if an action has been activated and dispatches the related action if it
has been.
This function should probably be split into several functions that are specific
to a binding type as the amount of actions grows.
*/
void OverlayController::processInputBindings()
void OverlayController::processMediaKeyBindings()
{
if ( m_actions.nextSong() )
{
@@ -489,6 +482,10 @@ void OverlayController::processInputBindings()
{
m_utilitiesTabController.sendMediaStopSong();
}
}
void OverlayController::processRoomBindings()
{
// Execution order for moveCenterTabController actions is important. Don't
// reorder these. Override actions must always come after normal because
// active priority is set based on which action is "newest"
@@ -511,6 +508,39 @@ void OverlayController::processInputBindings()
m_actions.optionalOverrideRightHandRoomTurn() );
}
void OverlayController::processPushToTalkBindings()
{
const auto pushToTalkCannotChange = !m_audioTabController.pttChangeValid();
if ( pushToTalkCannotChange )
{
return;
}
const auto pushToTalkButtonActivated = m_actions.pushToTalk();
const auto pushToTalkCurrentlyActive = m_audioTabController.pttActive();
if ( pushToTalkButtonActivated && !pushToTalkCurrentlyActive )
{
m_audioTabController.startPtt();
}
else if ( !pushToTalkButtonActivated && pushToTalkCurrentlyActive )
{
m_audioTabController.stopPtt();
}
}
/*!
Checks if an action has been activated and dispatches the related action if it
has been.
*/
void OverlayController::processInputBindings()
{
processMediaKeyBindings();
processRoomBindings();
processPushToTalkBindings();
}
// vsync implementation:
// (this function triggers every 1ms)
void OverlayController::OnTimeoutPumpEvents()