Skip to content

Commit da1aab2

Browse files
committed
Updating sdk to 2.2.3. Adding support for GetActionBindingInfo
1 parent acac54f commit da1aab2

File tree

5 files changed

+155
-23
lines changed

5 files changed

+155
-23
lines changed

Assets/SteamVR/Input/SteamVR_Action.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,33 @@ public override bool GetLastActiveBinding(SteamVR_Input_Sources inputSource)
266266
{
267267
return sourceMap[inputSource].lastActiveBinding;
268268
}
269+
270+
private static uint inputBindingInfo_size = 0;
271+
/// <summary>
272+
/// Gets all current active bindings for this action.
273+
/// Returns array of InputBindingInfo_t with strings: rchDevicePathName, rchInputPathName, rchInputSourceType, rchModeName, rchSlotName;
274+
/// </summary>
275+
/// <notes>This is not restricted by input source.</notes>
276+
public InputBindingInfo_t[] GetActionBindingInfo()
277+
{
278+
if (inputBindingInfo_size == 0)
279+
inputBindingInfo_size = (uint)Marshal.SizeOf(typeof(InputBindingInfo_t));
280+
281+
uint size = 0;
282+
EVRInputError err = OpenVR.Input.GetActionBindingInfo(this.handle, zeroLengthBindingInfos, inputBindingInfo_size, ref size);
283+
284+
if (err != EVRInputError.BufferTooSmall && err != EVRInputError.None)
285+
Debug.LogError("<b>[SteamVR]</b> GetActionBindingInfo error (" + fullPath + "): " + err.ToString() + " handle: " + handle.ToString());
286+
287+
InputBindingInfo_t[] bindingInfos = new InputBindingInfo_t[size];
288+
err = OpenVR.Input.GetActionBindingInfo(this.handle, bindingInfos, inputBindingInfo_size, ref size);
289+
290+
if (err != EVRInputError.BufferTooSmall && err != EVRInputError.None)
291+
Debug.LogError("<b>[SteamVR]</b> GetActionBindingInfo error (" + fullPath + "): " + err.ToString() + " handle: " + handle.ToString());
292+
293+
return bindingInfos;
294+
}
295+
private static InputBindingInfo_t[] zeroLengthBindingInfos = new InputBindingInfo_t[0];
269296
}
270297

271298

Assets/SteamVR/OpenVRUnityXRPackage/Editor/com.valvesoftware.unity.openvr-1.2.1.tgz renamed to Assets/SteamVR/OpenVRUnityXRPackage/Editor/com.valvesoftware.unity.openvr-1.2.2.tgz

18.6 MB
Binary file not shown.

Assets/SteamVR/OpenVRUnityXRPackage/Editor/com.valvesoftware.unity.openvr-1.2.1.tgz.meta renamed to Assets/SteamVR/OpenVRUnityXRPackage/Editor/com.valvesoftware.unity.openvr-1.2.2.tgz.meta

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)