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

        if (environment != null){
            controllerCount = 0;
            for(int i=0;i<JOpenVRLibrary.k_unMaxTrackedDeviceCount;i++) {
                int classCallback = ((OpenVR)environment.getVRHardware()).getVRSystem().GetTrackedDeviceClass.apply(i);
                if( classCallback == JOpenVRLibrary.ETrackedDeviceClass.ETrackedDeviceClass_TrackedDeviceClass_Controller || classCallback == JOpenVRLibrary.ETrackedDeviceClass.ETrackedDeviceClass_TrackedDeviceClass_GenericTracker) {

                    String controllerName   = "Unknown";
                    String manufacturerName = "Unknown";
                    try {
                        controllerName = OpenVRUtil.getTrackedDeviceStringProperty(((OpenVR)environment.getVRHardware()).getVRSystem(), i, JOpenVRLibrary.ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_TrackingSystemName_String);
                        manufacturerName = OpenVRUtil.getTrackedDeviceStringProperty(((OpenVR)environment.getVRHardware()).getVRSystem(), i, JOpenVRLibrary.ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_ManufacturerName_String);
                    } catch (Exception e) {
                      logger.log(Level.WARNING, e.getMessage(), e);
                    }

                    controllerIndex[controllerCount] = i;

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

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

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