Skip to content

Commit

Permalink
5.6.2 (#612)
Browse files Browse the repository at this point in the history
* add nlhomann json header

* add get scene app fn

* add get current binding and related logic

* add save binding file to settings folder

* apply binding fn added fixed uid bug

* add button logic to QML, add enable Bind Setting

* add finding logic for all custom bind

* fix minor qml issues

* fix get controllername bug, fix bug with save bind

* fix regex issue

* change webrequest for selectconfig

* change to properly urlify path to send

* fix race condition web requests

* change steamvr tab qml formatting

* change color scheme

* change colors of icons to text color

* change bind qml better for better ux

* add possible workaround for space drag issues

* add deact color to pushbutton

* increment version

* adjust button size in movecenter

* move nlhomann json

* fix PKGBUILD to include missing dependency (#606) (#613)

It turns out qt5-websockets needs to be included for a successful build.

Co-authored-by: James R <[email protected]>

* fix warning

* improved logging messages around perapp bindings

* improve getsceneappID logging

* add HMD based controller Finding

* improve logging controller name

* change logging around initial chaperone calibration

* increment version

* improve logging/error handling around sceneappid failures

* added fallback for getting scene app by pid

* update version string

* update documentation

Co-authored-by: James R <[email protected]>
  • Loading branch information
ykeara and ColdIce1605 authored Jul 28, 2022
1 parent 3be1133 commit 65b5aac
Show file tree
Hide file tree
Showing 102 changed files with 23,168 additions and 128 deletions.
15 changes: 15 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,20 @@ These version are not stable and this should be considered for advanced users on
- **Camera for Bounds**: Your camera view will replace your vr view as you near/exit chaperone
- **Camera for Dashboard**: You will have a small camera view attached to your controller when you have the dashboard active.
- **Camera for Room View**: You will have a Tron/Shadow version of the room when double-clicking system button.
- **Binds**
- **Enable Per-App**: Enables Per App Binding Feature
- **Application**: Application to set Per app Bindings
- **Common Overlay App Keys**
- (default) [OVR Advanced Settings](https://store.steampowered.com/app/1009850/OVR_Advanced_Settings/) = steam.overlay.1009850
- [OVR Toolkit](https://store.steampowered.com/app/1068820/OVR_Toolkit/) = steam.overlay.1068820
- [XSOverlay](https://store.steampowered.com/app/1173510/XSOverlay/) = steam.overlay.1173510
- [Desktop +](https://store.steampowered.com/app/1494460/Desktop/) = steam.overlay.1494460
- [fpsVR](https://store.steampowered.com/app/908520/fpsVR/) = steam.overlay.908520
- [LIV](https://store.steampowered.com/app/755540/LIV/) = steam.overlay.755540
- **Open Bindings**: another shortcut to the SteamVR Binding Menu
- **Save Current Binding of Selected App**:
- **For Current Game**: Saves your Current Binding of the selected game to be used on a per-app basis for this game.
- **As Default**: Saves your Current Binding of the selected game to be used if no other bindings are found when a new game loads.
- **Restart SteamVR**: Restart SteamVR (May crash the Steam overlay when SteamVR Home is running when you restart. Therefore I advice that you close SteamVR Home before restarting).

## - SteamVR Pair Page
Expand Down Expand Up @@ -437,6 +451,7 @@ Allows users to temporarily move and rotate the center of the playspace. This al
- **Left/Right Hand**: Toggles functionality (must be active in addition to binding via input system to work.)
- **Comfort Mode**: Limits the rate at which your movement updates, reducing smoothness so that perceived motion starts to feel more like mini-teleports. Higher values reduce smoothness more.
- **Force Bounds**: Forces the display of the chaperone bounds during Space Drag.
- **Ignore Boundary State**: Will for this session, ignroe the current state of the chaperone(boundary), this should improve compatibility with third party hmd's
- **Drag Multiplier**: Adds a Multiplier to the distance of your drag.
- **Height Toggle**: Toggle between zero and an offset for gravity floor height. If gravity is inactive the user is also moved to this offset. (Example: allows for quick switching between a seated and standing height.) Can be bound via SteamVr Input System.
- **On**: Current toggle state, Binds directly modify this.
Expand Down
2 changes: 1 addition & 1 deletion build_scripts/compile_version_string.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.5.0-release
5.6.2-release
1 change: 1 addition & 0 deletions build_scripts/qt/resources.pri
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ DISTFILES += \
src/res/qml/steamvr_page/steamvr_additional/* \
src/res/qml/steamvr_page/camera/* \
src/res/qml/steamvr_page/steamvrmisc/* \
src/res/qml/steamvr_page/steamvrbind/* \
src/res/qml/utilities_page/* \
src/res/qml/utilities_page/media_keys/* \
src/res/qml/utilities_page/keyboard_utils/* \
Expand Down
2 changes: 2 additions & 0 deletions build_scripts/qt/sources.pri
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ SOURCES += src/main.cpp\
src/openvr/ovr_overlay_wrapper.cpp \
src/openvr/ovr_system_wrapper.cpp \
src/openvr/lh_console_util.cpp \
src/openvr/ovr_application_wrapper.cpp \
src/utils/setup.cpp \
src/utils/paths.cpp \
src/utils/FrameRateUtils.cpp \
Expand Down Expand Up @@ -55,6 +56,7 @@ HEADERS += src/overlaycontroller.h \
src/openvr/ovr_settings_wrapper.h \
src/openvr/ovr_overlay_wrapper.h \
src/openvr/ovr_system_wrapper.h \
src/openvr/ovr_application_wrapper.h \
src/openvr/lh_console_util.h \
src/utils/setup.h \
src/utils/paths.h \
Expand Down
Binary file modified docs/screenshots/AudioPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/ChaperoneAdditionalPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/ChaperonePage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/ChaperoneWarningPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/FloorFixPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/MotionPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/OffsetPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/RootPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/RotationPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/SettingsPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/StatisticsPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/SteamVRPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/SteamVRPairPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/UtilitiesPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/VideoOverlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/VideoPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions src/openvr/ovr_application_wrapper.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include "ovr_application_wrapper.h"
constexpr uint32_t bufferLen = 4096;
namespace ovr_application_wrapper
{
std::string getSceneAppID()
{
uint32_t pidScene = vr::VRApplications()->GetCurrentSceneProcessId();
char key[bufferLen];
vr::EVRApplicationError error
= vr::VRApplications()->GetApplicationKeyByProcessId(
pidScene, key, bufferLen );
std::string keys = key;
if ( error != vr::VRApplicationError_None )
{
LOG( WARNING ) << "Could not Get App ID by PID: "
+ std::to_string( error );
LOG( WARNING ) << "Attempting to find through Enumeration";
auto appCount = vr::VRApplications()->GetApplicationCount();
const uint32_t bufferMax = vr::k_unMaxApplicationKeyLength;
char cStringOut[bufferMax];
for ( uint32_t i = 0; i < appCount; i++ )
{
auto error2 = vr::VRApplications()->GetApplicationKeyByIndex(
i, cStringOut, bufferMax );
std::string appID( cStringOut );
if ( appID.find( "steam.app" ) != std::string::npos )
{
LOG( WARNING ) << "Found App ID through Enumeration (only "
"steam apps caught): "
<< appID;
if ( error2 == vr::VRApplicationError_None )
{
return appID;
}
LOG( WARNING ) << "Error getting app id via Enum: " << error2;
}
}
LOG( ERROR ) << "Unable to Find App ID by PID or by Enumeration";
return "error";
}
return keys;
}

} // namespace ovr_application_wrapper
28 changes: 28 additions & 0 deletions src/openvr/ovr_application_wrapper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#pragma once

#include <openvr.h>
#include <iostream>
#include <string>
#include <easylogging++.h>
#include <utility>
#include <map>

/* Wrapper For OpenVR's IVR application class, allows us to do our error logging
* while also minimizing code
*
*/
namespace ovr_application_wrapper
{
// might make sense to mirror ovr's errors exactly, but for now this is more
// than sufficient

enum class ApplicationError
{
NoError,
UndefinedError,

};

std::string getSceneAppID();

} // namespace ovr_application_wrapper
107 changes: 107 additions & 0 deletions src/openvr/ovr_system_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,111 @@ std::vector<int> getAllConnectedDevices( bool onlyWearable )
return output;
}

std::string getControllerName()
{
// This call is deprecated but probably exactly what we need
int found = 0;
bool hasHMD = false;
uint32_t hmdIdx = 999;
uint32_t lftIdx = 999;
uint32_t rightIdx = 999;
for ( uint32_t i = 0; i < vr::k_unMaxTrackedDeviceCount; i++ )
{
auto trackedDeviceClass = vr::VRSystem()->GetTrackedDeviceClass( i );
if ( trackedDeviceClass == vr::TrackedDeviceClass_HMD )
{
hmdIdx = i;
hasHMD = true;
}
if ( trackedDeviceClass == vr::TrackedDeviceClass_Controller )
{
auto handRole = getInt32TrackedProperty(
i, vr::Prop_ControllerRoleHint_Int32 )
.second;
switch ( handRole )
{
case vr::TrackedControllerRole_LeftHand:
lftIdx = i;
found |= 0b100;
break;
case vr::TrackedControllerRole_RightHand:
rightIdx = i;
found |= 0b010;
break;
default:
break;
}
}
if ( found == 0b110 )
{
break;
}
}
bool isRightCon = false, isLeftCon = false;
std::string right, left;
if ( found == 0b110 || found == 0b100 )
{
isLeftCon = vr::VRSystem()->IsTrackedDeviceConnected( lftIdx );
if ( isLeftCon )
{
left = getStringTrackedProperty( lftIdx,
vr::Prop_ControllerType_String )
.second;
}
}
if ( found == 0b110 || found == 0b010 )
{
isRightCon = vr::VRSystem()->IsTrackedDeviceConnected( rightIdx );
if ( isRightCon )
{
right = getStringTrackedProperty( rightIdx,
vr::Prop_ControllerType_String )
.second;
}
}
if ( !isLeftCon && !isRightCon && hasHMD )
{
LOG( WARNING ) << "WARNING: No Controllers assuming based on HMD";
auto hmdName
= getStringTrackedProperty( hmdIdx, vr::Prop_ControllerType_String )
.second;
if ( hmdName == "indexhmd" )
{
return "knuckles";
}
if ( hmdName == "vive" )
{
return "vive_controller";
}
if ( hmdName == "vive_pro" )
{
LOG( WARNING )
<< "Vive Pro Detected, Assuming Knuckles this may be wrong";
return "knuckles";
}
if ( hmdName == "holographic_hmd" )
{
LOG( WARNING ) << "WMR detected, Assuming HP CONTROLLERS";
return "hpmotioncontroller";
}
if ( hmdName == "rift" )
{
return "oculus_touch";
}
LOG( WARNING ) << "Headset Not recognized Assuming touch controllers "
+ hmdName;
return "oculus_touch";
}
if ( right != left )
{
LOG( WARNING ) << "WARNING: Left and Right Controllers are Different, "
"Prioritizing right";
}
if ( rightIdx == 999 )
{
return left;
}
return right;
}

} // namespace ovr_system_wrapper
1 change: 1 addition & 0 deletions src/openvr/ovr_system_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@ vr::ETrackedDeviceClass getDeviceClass( int index );

std::vector<int> getAllConnectedDevices( bool onlyWearable = false );
std::string getDeviceName( int index );
std::string getControllerName();

} // namespace ovr_system_wrapper
11 changes: 11 additions & 0 deletions src/overlaycontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,17 @@ void OverlayController::mainEventLoop()
}
}
break;
case vr::VREvent_Input_ActionManifestReloaded:
{
// LOG( WARNING ) << "Action Manifest Reloaded";
if ( m_steamVRTabController.perAppBindEnabled() )
{
m_steamVRTabController.applyAllCustomBindings();
}
}
break;
default:
break;
}
}

Expand Down
21 changes: 21 additions & 0 deletions src/package_files/LICENSE.MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2013-2022 Niels Lohmann

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 51 additions & 1 deletion src/res/img/audio/media_keys/outline_skip_next_white_24dp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 65b5aac

Please sign in to comment.