Jump to content

Programmatically Get All Actions


Recommended Posts

@Annabell Can you elaborate more? I'm not sure I follow based on SteamVR's technology.

The "action" is defined by the developer and then mapped to a physical input either via the default binding configuration or a user-generated binding file https://valvesoftware.github.io/steamvr_unity_plugin/tutorials/SteamVR-Input.html.The controller input remaps around a-pre defined action - a controller's I/O is heavily customizable by the end user but only to the extent that it can work within the actions defined within the integration of the SteamVR/OpenVR plugin/SDK. I.E. you can remap a system button to report itself as any other input but it won't do anything unless there is an action in place for that input to map to.

Here's a video tutorial:


Link to comment
Share on other sites


Yes exactly the developer has to define Actions and match them to one or multiple buttons. You can then trigger those actions, but only when you exactly know what those actions are. 

For example in Unity it is possible to get all exisiting gameObjects via "UnityEngine.Object.FindObjectsOfType<GameObject>();". So you do not have to tell the code which gameobjects you have.

With actions I only figured out that you have to know the names of each action to trigger them, but I did not find a solution how to find out those actions and their corresponding names via a function.

@chengnay @zzy @Jad @Corvus

Link to comment
Share on other sites

  • 2 weeks later...

@Annabell By looking into SteamVR Plugin, there is a function(FindExistingActionForPartialPath) in SteamVR_Action.cs.

Probably you could write your own custom function that will give you actions by using names.

EDIT: I found a way that you could get a full list of actions

SteamVR_Input.actions <-- will return full array of SteamVR_Action

foreach(var action in SteamVR_Input.actions)
    Debug.Log("action: " + action.fullPath);

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...