@Override
    public void updateConnectedControllers() {
        logger.config("Updating connected controllers.");

        if (environment != null) {
            controllerCount = 0;
            for (int i = 0; i < VR.k_unMaxTrackedDeviceCount; i++) {
                int classCallback = VRSystem.VRSystem_GetTrackedDeviceClass(i);
                if (classCallback == VR.ETrackedDeviceClass_TrackedDeviceClass_Controller || classCallback == VR.ETrackedDeviceClass_TrackedDeviceClass_GenericTracker) {
                    IntBuffer error = BufferUtils.createIntBuffer(1);
                    String controllerName = "Unknown";
                    String manufacturerName = "Unknown";
                    controllerName = VRSystem.VRSystem_GetStringTrackedDeviceProperty(i, VR.ETrackedDeviceProperty_Prop_TrackingSystemName_String, error);
                    manufacturerName = VRSystem.VRSystem_GetStringTrackedDeviceProperty(i, VR.ETrackedDeviceProperty_Prop_ManufacturerName_String, error);

                    if (error.get(0) != 0) {
                        logger.warning("Error getting controller information " + controllerName + " " + manufacturerName + "Code (" + error.get(0) + ")");
                    }
                    controllerIndex[controllerCount] = i;

                    // Adding tracked controller to control.
                    if (trackedControllers == null) {
                        trackedControllers = new ArrayList<VRTrackedController>(VR.k_unMaxTrackedDeviceCount);
                    }
                    trackedControllers.add(new LWJGLOpenVRTrackedController(i, this, controllerName, manufacturerName, environment));

                    // Send a Haptic pulse to the controller
                    triggerHapticPulse(controllerCount, 1.0f);

                    controllerCount++;
                    logger.config("  Tracked controller " + (i + 1) + "/" + VR.k_unMaxTrackedDeviceCount + " " + controllerName + " (" + manufacturerName + ") attached.");
                } else {
                    logger.config("  Controller " + (i + 1) + "/" + VR.k_unMaxTrackedDeviceCount + " ignored.");
                }
            }
        } 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