Add media key bindings, update docs
All bindings are disabled by default. This is to prevent confusing behaviour from users who do not know about the new bindings. Forcing users to manually set up their bindings will also enable them to play around with the SteamVR bindings interface, which allows for much more versatile binding options that our current offerings. All actions are curently in main action set. If the selection of bindings was greatly expanded it could be beneficial to encapsulate the options more. The current code is more intended as a proof of concept until our full binding needs have been uncovered. The processInputBindings function should probably also be split into several functions of related bindings, as the amount of bindings grows.
This commit is contained in:
@@ -471,6 +471,33 @@ 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()
|
||||
{
|
||||
if ( m_actions.nextSong() )
|
||||
{
|
||||
m_utilitiesTabController.sendMediaNextSong();
|
||||
}
|
||||
if ( m_actions.previousSong() )
|
||||
{
|
||||
m_utilitiesTabController.sendMediaPreviousSong();
|
||||
}
|
||||
if ( m_actions.pausePlaySong() )
|
||||
{
|
||||
m_utilitiesTabController.sendMediaPausePlay();
|
||||
}
|
||||
if ( m_actions.stopSong() )
|
||||
{
|
||||
m_utilitiesTabController.sendMediaStopSong();
|
||||
}
|
||||
}
|
||||
|
||||
void OverlayController::OnTimeoutPumpEvents()
|
||||
{
|
||||
if ( !vr::VRSystem() )
|
||||
@@ -478,10 +505,7 @@ void OverlayController::OnTimeoutPumpEvents()
|
||||
|
||||
m_actions.UpdateStates();
|
||||
|
||||
if ( m_actions.nextSong() )
|
||||
{
|
||||
LOG( INFO ) << "NEXT SONG SET!";
|
||||
}
|
||||
processInputBindings();
|
||||
|
||||
vr::VREvent_t vrEvent;
|
||||
bool chaperoneDataAlreadyUpdated = false;
|
||||
|
||||
Reference in New Issue
Block a user