OpenXRInteractionProfile
Action bindings for one XR-controller interaction profile.
OpenXRInteractionProfile describes suggested bindings for a profile such as /interaction_profiles/khr/simple_controller. It is configuration data, not a connected controller or a report of the runtime-selected profile. A new resource has an empty path and no bindings or modifiers. Add it to OpenXRActionMap before XR-session creation.
Bindings stores OpenXRIPBinding records: one action and one complete path per record. Two hands require two records referencing the same action. The action resource must exist in a map’s set. Distinct records with an identical Action/BindingPath pair are not allowed.
GetBindings returns a shared Array. Duplicate() the container before replacement: self-assignment clears the list. This complete executed helper removes a record by index without changing its BindingPath or affecting other profiles using that same resource:
using System;
using Reckfell;
public static class ProfileBindingTools
{
// Removes a binding record from this profile, without changing the resource's path.
public static void RemoveAt(OpenXRInteractionProfile profile, int index)
{
ArgumentNullException.ThrowIfNull(profile);
using var shared = profile.GetBindings();
if (index < 0 || index >= shared.Count)
throw new ArgumentOutOfRangeException(nameof(index));
using var replacement = shared.Duplicate();
replacement.RemoveAt(index);
profile.SetBindings(replacement);
}
}This also avoids obsolete RemovePath: the current engine leaves a matching path unchanged. Clearing acceptance failed; engine source was not edited.
BindingModifiers differs: its getter creates an independent container with shared resources. Profile-level modifiers, such as D-pad, differ from per-binding modifiers. One modifier belongs to one profile and transfers when assigned elsewhere. Check runtime extension support separately.
Values, notifications, arrays, modifier transfer, the removal helper and the earlier map-persistence example were checked. OpenXR remained disabled; device profile acceptance, input, haptics, applied modifiers and XR sessions were not tested. Full setup: action map.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
OpenXRInteractionProfileConstructor
public OpenXRInteractionProfile();Creates a profile with an empty InteractionProfilePath and no bindings or modifiers. Does not discover a connected controller or select its runtime profile.
Properties3
BindingModifiersProperty
public Reckfell.Collections.Array BindingModifiers { get; set; }Profile-level modifiers, such as OpenXRDpadBindingModifier. The getter creates a new Array but shares resources: clearing the result does not remove profile modifiers. The setter removes old ownership links and re-adds resources; multiple Changed notifications are possible. One modifier belongs to one profile and transfers out of its previous profile. Distinct from per-OpenXRIPBinding modifiers; saving does not establish runtime extension support.
BindingsProperty
public Reckfell.Collections.Array Bindings { get; set; }OpenXRIPBinding list. The getter returns a shared Array; direct editing changes the resource and bypasses Changed/validation. The setter clears the list and adds bindings; repeated instances are ignored, while distinct instances with the same Action and BindingPath are rejected. Assigning its own shared getter array clears the list. Duplicate() the container before replacement; validate non-null entries and duplicates first. Resources inside a copy remain shared.
InteractionProfilePathProperty
public string InteractionProfilePath { get; set; }Complete interaction-profile path, initially empty; for example /interaction_profiles/khr/simple_controller. Not an action name or a specific button path. The setter uses engine metadata when available, stores the path and emits Changed even on repetition. Does not establish support by a connected runtime.
Methods10
GetBindingOpenXRIPBinding
public OpenXRIPBinding GetBinding(int index);Returns an existing binding resource at index 0…GetBindingCount()-1. The same resource, not a copy. Check bounds before calling.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexIndex from 0 inclusive to the corresponding Get…Count() exclusive. Check the count before calling.
OpenXRIPBindingThe same binding resource at a valid index.
GetBindingCountint
public int GetBindingCount();Binding-record count in the profile resource, initially 0. Not the number of connected devices or working device inputs.
intProfile binding-record count.
GetBindingModifierOpenXripBindingModifier
public OpenXripBindingModifier GetBindingModifier(int index);Reads an existing profile-level modifier at index 0…GetBindingModifierCount()-1. Distinct from a per-binding modifier type. The resource is shared; check the index first.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexIndex from 0 inclusive to the corresponding Get…Count() exclusive. Check the count before calling.
OpenXripBindingModifierThe same modifier resource for the corresponding level at a valid index.
GetBindingModifierCountint
public int GetBindingModifierCount();Profile-level modifier count. Does not establish extension support or actual runtime application.
intStored modifier count for the corresponding resource.
GetBindingModifiersReckfell.Collections.Array
public Reckfell.Collections.Array GetBindingModifiers();Profile-level modifiers, such as OpenXRDpadBindingModifier. The getter creates a new Array but shares resources: clearing the result does not remove profile modifiers. The setter removes old ownership links and re-adds resources; multiple Changed notifications are possible. One modifier belongs to one profile and transfers out of its previous profile. Distinct from per-OpenXRIPBinding modifiers; saving does not establish runtime extension support.
Reckfell.Collections.ArrayNew Array referencing the same modifier resources; not a deep copy.
GetBindingsReckfell.Collections.Array
public Reckfell.Collections.Array GetBindings();OpenXRIPBinding list. The getter returns a shared Array; direct editing changes the resource and bypasses Changed/validation. The setter clears the list and adds bindings; repeated instances are ignored, while distinct instances with the same Action and BindingPath are rejected. Assigning its own shared getter array clears the list. Duplicate() the container before replacement; validate non-null entries and duplicates first. Resources inside a copy remain shared.
Reckfell.Collections.ArrayShared profile Array; directly editing the container changes the profile.
GetInteractionProfilePathstring
public string GetInteractionProfilePath();Stored full profile path or an empty string. Resource configuration, not a report of the profile actually selected by a runtime.
stringStored profile string, initially empty.
SetBindingModifiersvoid
public void SetBindingModifiers(Reckfell.Collections.Array bindingModifiers);Profile-level modifiers, such as OpenXRDpadBindingModifier. The getter creates a new Array but shares resources: clearing the result does not remove profile modifiers. The setter removes old ownership links and re-adds resources; multiple Changed notifications are possible. One modifier belongs to one profile and transfers out of its previous profile. Distinct from per-OpenXRIPBinding modifiers; saving does not establish runtime extension support.
| Name | Type | Default |
|---|---|---|
bindingModifiers | Reckfell.Collections.Array | — |
bindingModifiersArray of profile-level modifiers such as OpenXRDpadBindingModifier; not per-binding modifiers.
SetBindingsvoid
public void SetBindings(Reckfell.Collections.Array bindings);OpenXRIPBinding list. The getter returns a shared Array; direct editing changes the resource and bypasses Changed/validation. The setter clears the list and adds bindings; repeated instances are ignored, while distinct instances with the same Action and BindingPath are rejected. Assigning its own shared getter array clears the list. Duplicate() the container before replacement; validate non-null entries and duplicates first. Resources inside a copy remain shared.
| Name | Type | Default |
|---|---|---|
bindings | Reckfell.Collections.Array | — |
bindingsSeparate Array of non-null OpenXRIPBinding resources without duplicate Action/BindingPath pairs. Duplicate() the container when starting from its own getter.
SetInteractionProfilePathvoid
public void SetInteractionProfilePath(string interactionProfilePath);Complete interaction-profile path, initially empty; for example /interaction_profiles/khr/simple_controller. Not an action name or a specific button path. The setter uses engine metadata when available, stores the path and emits Changed even on repetition. Does not establish support by a connected runtime.
| Name | Type | Default |
|---|---|---|
interactionProfilePath | string | — |
interactionProfilePathComplete valid profile path, for example /interaction_profiles/khr/simple_controller; not a button path.