@Override
    public void updateControllerStates() {

        if (environment != null) {
            switch(inputMode){
                case ACTION_BASED:
                    int errorCode = VRInput.VRInput_UpdateActionState(activeActionSets,  VRActiveActionSet.SIZEOF);
                    if(errorCode!=0){
                        logger.warning("An error code of " + errorCode + " was returned while upding the action states");
                    }
                    break;
                case LEGACY:
                    for (int i = 0; i < controllerCount; i++) {
                        int index = controllerIndex[i];
                        VRSystem.VRSystem_GetControllerState(index, cStates[index], 64);
                        cStates[index].ulButtonPressed();
                        cStates[index].rAxis();
                    }
                    break;
            }

        } else {
            throw new IllegalStateException("VR input is not attached to a VR environment.");
        }

    }
Create a new
<a href="https://github.com/ValveSoftware/openvr/wiki/API-Documentation">OpenVR</a>
input attached to the given VR environment.

@param environment the VR environment to which the input is attached.
jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRInput.java