Refactor actions into separate action sets (#122)
* Fix indentation in action manifest * Rename action sets to drop unnecessary prefix notation Since the variable is in the action_sets namespace it does not make sense to prepend it with an identifier for it being constant, or a set. * Rename input keys to drop prefix notation The vars are in a namespace that only contains constant inputs, it doesn't make sense to prepend it to every var. * Rename actions to drop prefixes It is implicit that actions are const values for sets, therefore the prefix is not needed. * Remove unneeded action set member func * Move active action set in preparation for more action sets * Move action strings above class Class is not able to use variables in namespaces, which is stupid. * Move sets into member variable * Split music into separate action set * Convert action_manifest.json to spaces only * Refactor actions into separate action sets * Rename main set to haptic * Reorder action sets The haptics and misc sets are misc bindings. * format * fixed manifest path issue * Change path concat to use QDir The old way was not platform independent. * Move accessibility actions to motion set * Remove "(Held)" from action name Might be confusing for end users. * Replace slash with platform independent separator * Make paths output native paths
This commit is contained in:
+38
-36
@@ -2,6 +2,7 @@
|
||||
#include "ivrinput_action.h"
|
||||
#include <openvr.h>
|
||||
#include <iostream>
|
||||
#include <array>
|
||||
#include <easylogging++.h>
|
||||
|
||||
namespace input
|
||||
@@ -99,45 +100,46 @@ Wrong action names may not result in direct error messages, but just features
|
||||
mystically not working.
|
||||
*/
|
||||
SteamIVRInput::SteamIVRInput()
|
||||
: m_manifest(), m_mainSet( action_sets::k_setMain ),
|
||||
m_nextTrack( action_keys::k_actionNextTrack ),
|
||||
m_previousTrack( action_keys::k_actionPreviousTrack ),
|
||||
m_pausePlayTrack( action_keys::k_actionPausePlayTrack ),
|
||||
m_stopTrack( action_keys::k_actionStopTrack ),
|
||||
m_leftHandSpaceTurn( action_keys::k_actionLeftHandSpaceTurn ),
|
||||
m_rightHandSpaceTurn( action_keys::k_actionRightHandSpaceTurn ),
|
||||
m_leftHandSpaceDrag( action_keys::k_actionLeftHandSpaceDrag ),
|
||||
m_rightHandSpaceDrag( action_keys::k_actionRightHandSpaceDrag ),
|
||||
: m_manifest(), m_mainSet( action_sets::haptic ),
|
||||
m_music( action_sets::music ), m_motion( action_sets::motion ),
|
||||
m_misc( action_sets::misc ), m_nextTrack( action_keys::nextTrack ),
|
||||
m_previousTrack( action_keys::previousTrack ),
|
||||
m_pausePlayTrack( action_keys::pausePlayTrack ),
|
||||
m_stopTrack( action_keys::stopTrack ),
|
||||
m_leftHandSpaceTurn( action_keys::leftHandSpaceTurn ),
|
||||
m_rightHandSpaceTurn( action_keys::rightHandSpaceTurn ),
|
||||
m_leftHandSpaceDrag( action_keys::leftHandSpaceDrag ),
|
||||
m_rightHandSpaceDrag( action_keys::rightHandSpaceDrag ),
|
||||
m_optionalOverrideLeftHandSpaceTurn(
|
||||
action_keys::k_actionOptionalOverrideLeftHandSpaceTurn ),
|
||||
action_keys::optionalOverrideLeftHandSpaceTurn ),
|
||||
m_optionalOverrideRightHandSpaceTurn(
|
||||
action_keys::k_actionOptionalOverrideRightHandSpaceTurn ),
|
||||
action_keys::optionalOverrideRightHandSpaceTurn ),
|
||||
m_optionalOverrideLeftHandSpaceDrag(
|
||||
action_keys::k_actionOptionalOverrideLeftHandSpaceDrag ),
|
||||
action_keys::optionalOverrideLeftHandSpaceDrag ),
|
||||
m_optionalOverrideRightHandSpaceDrag(
|
||||
action_keys::k_actionOptionalOverrideRightHandSpaceDrag ),
|
||||
action_keys::optionalOverrideRightHandSpaceDrag ),
|
||||
m_swapSpaceDragToLeftHandOverride(
|
||||
action_keys::k_actionSwapSpaceDragToLeftHandOverride ),
|
||||
action_keys::swapSpaceDragToLeftHandOverride ),
|
||||
m_swapSpaceDragToRightHandOverride(
|
||||
action_keys::k_actionSwapSpaceDragToRightHandOverride ),
|
||||
m_gravityToggle( action_keys::k_actionGravityToggle ),
|
||||
m_gravityReverse( action_keys::k_actionGravityReverse ),
|
||||
m_heightToggle( action_keys::k_actionHeightToggle ),
|
||||
m_resetOffsets( action_keys::k_actionResetOffsets ),
|
||||
m_snapTurnLeft( action_keys::k_actionSnapTurnLeft ),
|
||||
m_snapTurnRight( action_keys::k_actionSnapTurnRight ),
|
||||
m_xAxisLockToggle( action_keys::k_actionXAxisLockToggle ),
|
||||
m_yAxisLockToggle( action_keys::k_actionYAxisLockToggle ),
|
||||
m_zAxisLockToggle( action_keys::k_actionZAxisLockToggle ),
|
||||
m_pushToTalk( action_keys::k_actionPushToTalk ),
|
||||
m_leftHaptic( action_keys::k_actionHapticsLeft ),
|
||||
m_rightHaptic( action_keys::k_actionHapticsRight ),
|
||||
m_leftHand( input_keys::k_inputSourceLeft ),
|
||||
m_rightHand( input_keys::k_inputSourceRight )
|
||||
action_keys::swapSpaceDragToRightHandOverride ),
|
||||
m_gravityToggle( action_keys::gravityToggle ),
|
||||
m_gravityReverse( action_keys::gravityReverse ),
|
||||
m_heightToggle( action_keys::heightToggle ),
|
||||
m_resetOffsets( action_keys::resetOffsets ),
|
||||
m_snapTurnLeft( action_keys::snapTurnLeft ),
|
||||
m_snapTurnRight( action_keys::snapTurnRight ),
|
||||
m_xAxisLockToggle( action_keys::xAxisLockToggle ),
|
||||
m_yAxisLockToggle( action_keys::yAxisLockToggle ),
|
||||
m_zAxisLockToggle( action_keys::zAxisLockToggle ),
|
||||
m_pushToTalk( action_keys::pushToTalk ),
|
||||
m_leftHaptic( action_keys::hapticsLeft ),
|
||||
m_rightHaptic( action_keys::hapticsRight ),
|
||||
m_leftHand( input_keys::leftHand ), m_rightHand( input_keys::rightHand ),
|
||||
m_sets( { m_mainSet.activeActionSet(),
|
||||
m_music.activeActionSet(),
|
||||
m_motion.activeActionSet(),
|
||||
m_misc.activeActionSet() } )
|
||||
{
|
||||
m_activeActionSet.ulActionSet = m_mainSet.handle();
|
||||
m_activeActionSet.ulRestrictedToDevice = vr::k_ulInvalidInputValueHandle;
|
||||
m_activeActionSet.nPriority = 0;
|
||||
}
|
||||
/*!
|
||||
Returns true if the next media track should be played.
|
||||
@@ -328,10 +330,10 @@ update state.
|
||||
*/
|
||||
void SteamIVRInput::UpdateStates()
|
||||
{
|
||||
constexpr auto numberOfSets = 1;
|
||||
|
||||
const auto error = vr::VRInput()->UpdateActionState(
|
||||
&m_activeActionSet, sizeof( m_activeActionSet ), numberOfSets );
|
||||
const auto error
|
||||
= vr::VRInput()->UpdateActionState( m_sets.data(),
|
||||
sizeof( vr::VRActiveActionSet_t ),
|
||||
action_sets::numberOfSets );
|
||||
|
||||
if ( error != vr::EVRInputError::VRInputError_None )
|
||||
{
|
||||
|
||||
+77
-69
@@ -5,9 +5,80 @@
|
||||
#include "ivrinput_manifest.h"
|
||||
#include "ivrinput_action_set.h"
|
||||
#include "ivrinput_input_source.h"
|
||||
#include <array>
|
||||
|
||||
namespace input
|
||||
{
|
||||
/*!
|
||||
The IVRInput system is _very_ finnicky about strings matching and if they don't
|
||||
match there are usually no errors logged reflecting that. constexpr auto strings
|
||||
should be used to refer to all action manifest strings.
|
||||
*/
|
||||
namespace action_keys
|
||||
{
|
||||
constexpr auto nextTrack = "/actions/music/in/NextTrack";
|
||||
constexpr auto previousTrack = "/actions/music/in/PreviousTrack";
|
||||
constexpr auto pausePlayTrack = "/actions/music/in/PausePlayTrack";
|
||||
constexpr auto stopTrack = "/actions/music/in/StopTrack";
|
||||
|
||||
constexpr auto leftHandSpaceTurn = "/actions/motion/in/LeftHandSpaceTurn";
|
||||
constexpr auto rightHandSpaceTurn = "/actions/motion/in/RightHandSpaceTurn";
|
||||
constexpr auto leftHandSpaceDrag = "/actions/motion/in/LeftHandSpaceDrag";
|
||||
constexpr auto rightHandSpaceDrag = "/actions/motion/in/RightHandSpaceDrag";
|
||||
constexpr auto optionalOverrideLeftHandSpaceTurn
|
||||
= "/actions/motion/in/OptionalOverrideLeftHandSpaceTurn";
|
||||
constexpr auto optionalOverrideRightHandSpaceTurn
|
||||
= "/actions/motion/in/OptionalOverrideRightHandSpaceTurn";
|
||||
constexpr auto optionalOverrideLeftHandSpaceDrag
|
||||
= "/actions/motion/in/OptionalOverrideLeftHandSpaceDrag";
|
||||
constexpr auto optionalOverrideRightHandSpaceDrag
|
||||
= "/actions/motion/in/OptionalOverrideRightHandSpaceDrag";
|
||||
constexpr auto swapSpaceDragToLeftHandOverride
|
||||
= "/actions/motion/in/SwapSpaceDragToLeftHandOverride";
|
||||
constexpr auto swapSpaceDragToRightHandOverride
|
||||
= "/actions/motion/in/SwapSpaceDragToRightHandOverride";
|
||||
constexpr auto gravityToggle = "/actions/motion/in/GravityToggle";
|
||||
constexpr auto gravityReverse = "/actions/motion/in/GravityReverse";
|
||||
constexpr auto resetOffsets = "/actions/motion/in/ResetOffsets";
|
||||
constexpr auto heightToggle = "/actions/motion/in/HeightToggle";
|
||||
constexpr auto snapTurnLeft = "/actions/motion/in/SnapTurnLeft";
|
||||
constexpr auto snapTurnRight = "/actions/motion/in/SnapTurnRight";
|
||||
|
||||
constexpr auto xAxisLockToggle = "/actions/misc/in/XAxisLockToggle";
|
||||
constexpr auto yAxisLockToggle = "/actions/misc/in/YAxisLockToggle";
|
||||
constexpr auto zAxisLockToggle = "/actions/misc/in/ZAxisLockToggle";
|
||||
constexpr auto pushToTalk = "/actions/misc/in/PushToTalk";
|
||||
|
||||
constexpr auto hapticsLeft = "/actions/haptic/out/HapticsLeft";
|
||||
constexpr auto hapticsRight = "/actions/haptic/out/HapticsRight";
|
||||
constexpr auto proxSensor = "/actions/haptic/in/ProxSensor";
|
||||
|
||||
} // namespace action_keys
|
||||
|
||||
/*!
|
||||
Keys to get input source handles (things like hmd controllers etc.)
|
||||
*/
|
||||
namespace input_keys
|
||||
{
|
||||
constexpr auto leftHand = "/user/hand/left";
|
||||
constexpr auto rightHand = "/user/hand/right";
|
||||
} // namespace input_keys
|
||||
|
||||
/*!
|
||||
Keys for different action sets
|
||||
*/
|
||||
namespace action_sets
|
||||
{
|
||||
constexpr auto numberOfSets = 4;
|
||||
constexpr auto haptic = "/actions/haptic";
|
||||
constexpr auto music = "/actions/music";
|
||||
constexpr auto misc = "/actions/misc";
|
||||
constexpr auto motion = "/actions/motion";
|
||||
} // namespace action_sets
|
||||
|
||||
using ActiveActionSets
|
||||
= std::array<vr::VRActiveActionSet_t, action_sets::numberOfSets>;
|
||||
|
||||
/*!
|
||||
Responsible for controller input.
|
||||
|
||||
@@ -92,7 +163,9 @@ private:
|
||||
Manifest m_manifest;
|
||||
|
||||
ActionSet m_mainSet;
|
||||
vr::VRActiveActionSet_t m_activeActionSet = {};
|
||||
ActionSet m_music;
|
||||
ActionSet m_motion;
|
||||
ActionSet m_misc;
|
||||
|
||||
// Music player bindings
|
||||
DigitalAction m_nextTrack;
|
||||
@@ -131,74 +204,9 @@ private:
|
||||
// input sources
|
||||
InputSource m_leftHand;
|
||||
InputSource m_rightHand;
|
||||
|
||||
// Initialize the set of actions after everything else.
|
||||
ActiveActionSets m_sets;
|
||||
};
|
||||
|
||||
/*!
|
||||
The IVRInput system is _very_ finnicky about strings matching and if they don't
|
||||
match there are usually no errors logged reflecting that. constexpr auto strings
|
||||
should be used to refer to all action manifest strings.
|
||||
*/
|
||||
namespace action_keys
|
||||
{
|
||||
constexpr auto k_actionNextTrack = "/actions/main/in/NextTrack";
|
||||
constexpr auto k_actionPreviousTrack = "/actions/main/in/PreviousTrack";
|
||||
constexpr auto k_actionPausePlayTrack = "/actions/main/in/PausePlayTrack";
|
||||
constexpr auto k_actionStopTrack = "/actions/main/in/StopTrack";
|
||||
|
||||
constexpr auto k_actionLeftHandSpaceTurn
|
||||
= "/actions/main/in/LeftHandSpaceTurn";
|
||||
constexpr auto k_actionRightHandSpaceTurn
|
||||
= "/actions/main/in/RightHandSpaceTurn";
|
||||
constexpr auto k_actionLeftHandSpaceDrag
|
||||
= "/actions/main/in/LeftHandSpaceDrag";
|
||||
constexpr auto k_actionRightHandSpaceDrag
|
||||
= "/actions/main/in/RightHandSpaceDrag";
|
||||
constexpr auto k_actionOptionalOverrideLeftHandSpaceTurn
|
||||
= "/actions/main/in/OptionalOverrideLeftHandSpaceTurn";
|
||||
constexpr auto k_actionOptionalOverrideRightHandSpaceTurn
|
||||
= "/actions/main/in/OptionalOverrideRightHandSpaceTurn";
|
||||
constexpr auto k_actionOptionalOverrideLeftHandSpaceDrag
|
||||
= "/actions/main/in/OptionalOverrideLeftHandSpaceDrag";
|
||||
constexpr auto k_actionOptionalOverrideRightHandSpaceDrag
|
||||
= "/actions/main/in/OptionalOverrideRightHandSpaceDrag";
|
||||
constexpr auto k_actionSwapSpaceDragToLeftHandOverride
|
||||
= "/actions/main/in/SwapSpaceDragToLeftHandOverride";
|
||||
constexpr auto k_actionSwapSpaceDragToRightHandOverride
|
||||
= "/actions/main/in/SwapSpaceDragToRightHandOverride";
|
||||
constexpr auto k_actionGravityToggle = "/actions/main/in/GravityToggle";
|
||||
constexpr auto k_actionGravityReverse = "/actions/main/in/GravityReverse";
|
||||
constexpr auto k_actionHeightToggle = "/actions/main/in/HeightToggle";
|
||||
constexpr auto k_actionResetOffsets = "/actions/main/in/ResetOffsets";
|
||||
constexpr auto k_actionSnapTurnLeft = "/actions/main/in/SnapTurnLeft";
|
||||
constexpr auto k_actionSnapTurnRight = "/actions/main/in/SnapTurnRight";
|
||||
constexpr auto k_actionXAxisLockToggle = "/actions/main/in/XAxisLockToggle";
|
||||
constexpr auto k_actionYAxisLockToggle = "/actions/main/in/YAxisLockToggle";
|
||||
constexpr auto k_actionZAxisLockToggle = "/actions/main/in/ZAxisLockToggle";
|
||||
|
||||
constexpr auto k_actionPushToTalk = "/actions/main/in/PushToTalk";
|
||||
|
||||
constexpr auto k_actionHapticsLeft = "/actions/main/out/HapticsLeft";
|
||||
constexpr auto k_actionHapticsRight = "/actions/main/out/HapticsRight";
|
||||
|
||||
constexpr auto k_actionProxSensor = "/actions/main/in/ProxSensor";
|
||||
|
||||
} // namespace action_keys
|
||||
|
||||
/*!
|
||||
Keys to get input source handles (things like hmd controllers etc.)
|
||||
*/
|
||||
namespace input_keys
|
||||
{
|
||||
constexpr auto k_inputSourceLeft = "/user/hand/left";
|
||||
constexpr auto k_inputSourceRight = "/user/hand/right";
|
||||
} // namespace input_keys
|
||||
|
||||
/*!
|
||||
Keys for different action sets
|
||||
*/
|
||||
namespace action_sets
|
||||
{
|
||||
constexpr auto k_setMain = "/actions/main";
|
||||
} // namespace action_sets
|
||||
|
||||
} // namespace input
|
||||
|
||||
@@ -10,33 +10,28 @@ Represents an action set from the action manifest.
|
||||
class ActionSet
|
||||
{
|
||||
public:
|
||||
ActionSet( const char* setName ) : m_name( setName )
|
||||
ActionSet( const char* setName )
|
||||
{
|
||||
auto error = vr::VRInput()->GetActionSetHandle( setName, &m_handle );
|
||||
vr::VRActionSetHandle_t handle = 0;
|
||||
auto error = vr::VRInput()->GetActionSetHandle( setName, &handle );
|
||||
if ( error != vr::EVRInputError::VRInputError_None )
|
||||
{
|
||||
LOG( ERROR ) << "Error getting handle for '" << setName
|
||||
<< "'. OpenVR Error: " << error;
|
||||
}
|
||||
|
||||
m_activeActionSet.ulActionSet = handle;
|
||||
m_activeActionSet.ulRestrictedToDevice
|
||||
= vr::k_ulInvalidInputValueHandle;
|
||||
m_activeActionSet.nPriority = 0;
|
||||
}
|
||||
/*!
|
||||
The actions manfiest name of the set. Used for error reporting.
|
||||
*/
|
||||
std::string name()
|
||||
vr::VRActiveActionSet_t activeActionSet()
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
/*!
|
||||
An API internal handle that identifies a set.
|
||||
*/
|
||||
vr::VRActionSetHandle_t handle()
|
||||
{
|
||||
return m_handle;
|
||||
return m_activeActionSet;
|
||||
}
|
||||
|
||||
private:
|
||||
const std::string m_name;
|
||||
vr::VRActionSetHandle_t m_handle = 0;
|
||||
vr::VRActiveActionSet_t m_activeActionSet = {};
|
||||
};
|
||||
|
||||
} // namespace input
|
||||
|
||||
@@ -6,151 +6,166 @@
|
||||
},
|
||||
{
|
||||
"controller_type" : "generic",
|
||||
"binding_url" : "default_action_manifests/generic_hmd_defaults.json"
|
||||
"binding_url" : "default_action_manifests/generic_hmd_defaults.json"
|
||||
},
|
||||
{
|
||||
"controller_type" : "vive",
|
||||
"binding_url" : "default_action_manifests/vive_hmd_defaults.json"
|
||||
"binding_url" : "default_action_manifests/vive_hmd_defaults.json"
|
||||
}
|
||||
],
|
||||
"actions": [
|
||||
{
|
||||
"name": "/actions/main/in/NextTrack",
|
||||
"name": "/actions/music/in/NextTrack",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/PreviousTrack",
|
||||
"name": "/actions/music/in/PreviousTrack",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/PausePlayTrack",
|
||||
"name": "/actions/music/in/PausePlayTrack",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/StopTrack",
|
||||
"name": "/actions/music/in/StopTrack",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/ProxSensor",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/out/HapticsLeft",
|
||||
"type": "vibration"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/out/HapticsRight",
|
||||
"type": "vibration"
|
||||
},
|
||||
|
||||
{
|
||||
"name": "/actions/main/in/LeftHandSpaceTurn",
|
||||
"name": "/actions/haptic/in/ProxSensor",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/RightHandSpaceTurn",
|
||||
"name": "/actions/haptic/out/HapticsLeft",
|
||||
"type": "vibration"
|
||||
},
|
||||
{
|
||||
"name": "/actions/haptic/out/HapticsRight",
|
||||
"type": "vibration"
|
||||
},
|
||||
|
||||
{
|
||||
"name": "/actions/motion/in/LeftHandSpaceTurn",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/LeftHandSpaceDrag",
|
||||
"name": "/actions/motion/in/RightHandSpaceTurn",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/RightHandSpaceDrag",
|
||||
"name": "/actions/motion/in/LeftHandSpaceDrag",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/OptionalOverrideLeftHandSpaceTurn",
|
||||
"name": "/actions/motion/in/RightHandSpaceDrag",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/OptionalOverrideRightHandSpaceTurn",
|
||||
"name": "/actions/motion/in/OptionalOverrideLeftHandSpaceTurn",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/OptionalOverrideLeftHandSpaceDrag",
|
||||
"name": "/actions/motion/in/OptionalOverrideRightHandSpaceTurn",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/OptionalOverrideRightHandSpaceDrag",
|
||||
"name": "/actions/motion/in/OptionalOverrideLeftHandSpaceDrag",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/SwapSpaceDragToLeftHandOverride",
|
||||
"name": "/actions/motion/in/OptionalOverrideRightHandSpaceDrag",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/SwapSpaceDragToRightHandOverride",
|
||||
"name": "/actions/motion/in/SwapSpaceDragToLeftHandOverride",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/GravityToggle",
|
||||
"name": "/actions/motion/in/SwapSpaceDragToRightHandOverride",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/GravityReverse",
|
||||
"name": "/actions/motion/in/GravityToggle",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/HeightToggle",
|
||||
"name": "/actions/motion/in/GravityReverse",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/ResetOffsets",
|
||||
"name": "/actions/motion/in/ResetOffsets",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/SnapTurnLeft",
|
||||
"name": "/actions/motion/in/HeightToggle",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/SnapTurnRight",
|
||||
"name": "/actions/motion/in/SnapTurnLeft",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/XAxisLockToggle",
|
||||
"name": "/actions/motion/in/SnapTurnRight",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
|
||||
{
|
||||
"name": "/actions/misc/in/XAxisLockToggle",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/YAxisLockToggle",
|
||||
"name": "/actions/misc/in/YAxisLockToggle",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/ZAxisLockToggle",
|
||||
"name": "/actions/misc/in/ZAxisLockToggle",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/main/in/PushToTalk",
|
||||
"name": "/actions/misc/in/PushToTalk",
|
||||
"requirement": "optional",
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"action_sets": [
|
||||
{
|
||||
"name": "/actions/main",
|
||||
"name": "/actions/motion",
|
||||
"usage": "leftright"
|
||||
},
|
||||
{
|
||||
"name": "/actions/music",
|
||||
"usage": "leftright"
|
||||
},
|
||||
{
|
||||
"name": "/actions/misc",
|
||||
"usage": "leftright"
|
||||
},
|
||||
{
|
||||
"name": "/actions/haptic",
|
||||
"usage": "leftright"
|
||||
}
|
||||
],
|
||||
@@ -158,35 +173,41 @@
|
||||
{
|
||||
"language_tag": "en_US",
|
||||
|
||||
"/actions/main" : "Advanced Settings Actions",
|
||||
"/actions/haptic" : "Haptics",
|
||||
"/actions/music" : "Music",
|
||||
"/actions/misc" : "Misc",
|
||||
"/actions/accessibility" : "Accessibility",
|
||||
"/actions/motion" : "Motion",
|
||||
|
||||
"/actions/main/in/NextTrack" : "Play Next Track",
|
||||
"/actions/main/in/PreviousTrack" : "Play Previous Track",
|
||||
"/actions/main/in/PausePlayTrack" : "Pause/Play Track",
|
||||
"/actions/main/in/StopTrack" : "Stop Track",
|
||||
"/actions/main/out/HapticsLeft" : "Haptics Left",
|
||||
"/actions/main/out/HapticsRight" : " Haptics Right",
|
||||
"/actions/main/in/LeftHandSpaceTurn" : "Left Hand Space Turn",
|
||||
"/actions/main/in/RightHandSpaceTurn" : "Right Hand Space Turn",
|
||||
"/actions/main/in/LeftHandSpaceDrag" : "Left Hand Space Drag",
|
||||
"/actions/main/in/RightHandSpaceDrag" : "Right Hand Space Drag",
|
||||
"/actions/main/in/OptionalOverrideLeftHandSpaceTurn" : "(Optional Override) Left Hand Space Turn",
|
||||
"/actions/main/in/OptionalOverrideRightHandSpaceTurn" : "(Optional Override) Right Hand Space Turn",
|
||||
"/actions/main/in/OptionalOverrideLeftHandSpaceDrag" : "(Optional Override) Left Hand Space Drag",
|
||||
"/actions/main/in/OptionalOverrideRightHandSpaceDrag" : "(Optional Override) Right Hand Space Drag",
|
||||
"/actions/main/in/SwapSpaceDragToLeftHandOverride" : "Swap Active Space Drag to Left Hand (Override)",
|
||||
"/actions/main/in/SwapSpaceDragToRightHandOverride" : "Swap Active Space Drag to Right Hand (Override)",
|
||||
"/actions/main/in/GravityToggle" : "Gravity Toggle",
|
||||
"/actions/main/in/GravityReverse" : "Gravity Reverse (Held)",
|
||||
"/actions/main/in/HeightToggle" : "Height Toggle",
|
||||
"/actions/main/in/ResetOffsets" : "Reset Offsets",
|
||||
"/actions/main/in/SnapTurnLeft" : "Snap-Turn Left",
|
||||
"/actions/main/in/SnapTurnRight" : "Snap-Turn Right",
|
||||
"/actions/main/in/XAxisLockToggle" : "X-Axis Lock Toggle",
|
||||
"/actions/main/in/YAxisLockToggle" : "Y-Axis Lock Toggle",
|
||||
"/actions/main/in/ZAxisLockToggle" : "Z-Axis Lock Toggle",
|
||||
"/actions/music/in/NextTrack" : "Play Next Track",
|
||||
"/actions/music/in/PreviousTrack" : "Play Previous Track",
|
||||
"/actions/music/in/PausePlayTrack" : "Pause/Play Track",
|
||||
"/actions/music/in/StopTrack" : "Stop Track",
|
||||
|
||||
"/actions/main/in/PushToTalk" : "Push To Talk"
|
||||
"/actions/motion/out/HapticsLeft" : "Haptics Left",
|
||||
"/actions/motion/out/HapticsRight" : " Haptics Right",
|
||||
"/actions/motion/in/LeftHandSpaceTurn" : "Left Hand Space Turn",
|
||||
"/actions/motion/in/RightHandSpaceTurn" : "Right Hand Space Turn",
|
||||
"/actions/motion/in/LeftHandSpaceDrag" : "Left Hand Space Drag",
|
||||
"/actions/motion/in/RightHandSpaceDrag" : "Right Hand Space Drag",
|
||||
"/actions/motion/in/OptionalOverrideLeftHandSpaceTurn" : "(Optional Override) Left Hand Space Turn",
|
||||
"/actions/motion/in/OptionalOverrideRightHandSpaceTurn" : "(Optional Override) Right Hand Space Turn",
|
||||
"/actions/motion/in/OptionalOverrideLeftHandSpaceDrag" : "(Optional Override) Left Hand Space Drag",
|
||||
"/actions/motion/in/OptionalOverrideRightHandSpaceDrag" : "(Optional Override) Right Hand Space Drag",
|
||||
"/actions/motion/in/SwapSpaceDragToLeftHandOverride" : "Swap Active Space Drag to Left Hand (Override)",
|
||||
"/actions/motion/in/SwapSpaceDragToRightHandOverride" : "Swap Active Space Drag to Right Hand (Override)",
|
||||
"/actions/motion/in/GravityToggle" : "Gravity Toggle",
|
||||
"/actions/motion/in/GravityReverse" : "Gravity Reverse",
|
||||
"/actions/motion/in/ResetOffsets" : "Reset Offsets",
|
||||
|
||||
"/actions/accessibility/in/HeightToggle" : "Height Toggle",
|
||||
"/actions/accessibility/in/SnapTurnLeft" : "Snap-Turn Left",
|
||||
"/actions/accessibility/in/SnapTurnRight" : "Snap-Turn Right",
|
||||
|
||||
"/actions/misc/in/XAxisLockToggle" : "X-Axis Lock Toggle",
|
||||
"/actions/misc/in/YAxisLockToggle" : "Y-Axis Lock Toggle",
|
||||
"/actions/misc/in/ZAxisLockToggle" : "Z-Axis Lock Toggle",
|
||||
"/actions/misc/in/PushToTalk" : "Push To Talk"
|
||||
}
|
||||
]
|
||||
}
|
||||
+5
-4
@@ -4,6 +4,7 @@
|
||||
#include <QString>
|
||||
#include <QFileInfo>
|
||||
#include <easylogging++.h>
|
||||
#include <QDir>
|
||||
|
||||
namespace paths
|
||||
{
|
||||
@@ -29,9 +30,9 @@ optional<string> binaryDirectoryFindFile( const string fileName )
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
const auto filePath = QString::fromStdString( *path ) + "/"
|
||||
+ QString::fromStdString( fileName );
|
||||
QFileInfo file( filePath );
|
||||
const auto filePath = QDir( QString::fromStdString( *path ) + '/'
|
||||
+ QString::fromStdString( fileName ) );
|
||||
QFileInfo file( filePath.path() );
|
||||
|
||||
if ( !file.exists() )
|
||||
{
|
||||
@@ -40,7 +41,7 @@ optional<string> binaryDirectoryFindFile( const string fileName )
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return filePath.toStdString();
|
||||
return QDir::toNativeSeparators( file.filePath() ).toStdString();
|
||||
}
|
||||
|
||||
optional<string> settingsDirectory()
|
||||
|
||||
@@ -146,6 +146,7 @@ void reinstallApplicationManifest( const std::string manifestPath )
|
||||
if ( vr::VRApplications()->IsApplicationInstalled(
|
||||
application_strings::applicationKey ) )
|
||||
{
|
||||
LOG( INFO ) << "Manifest Previously Installed";
|
||||
// String size was arbitrarily chosen by original author.
|
||||
constexpr auto kStringSize = 1024;
|
||||
char oldApplicationWorkingDir[kStringSize] = { 0 };
|
||||
|
||||
Reference in New Issue
Block a user