@Override
    public void onAction(String name, boolean keyPressed, float tpf) {
        if (dragToRotate) {
            if (name.equals(CameraInput.CHASECAM_TOGGLEROTATE) && enabled) {
                if (keyPressed) {
                    canRotate = true;
                    if (hideCursorOnRotate) {
                        inputManager.setCursorVisible(false);
                    }
                } else {
                    canRotate = false;
                    if (hideCursorOnRotate) {
                        inputManager.setCursorVisible(true);
                    }
                }
            }
        }
    }
Constructs the chase camera, and registers inputs
@param cam the application camera
@param target the spatial to follow
@param inputManager the inputManager of the application to register inputs
jme3-core/src/main/java/com/jme3/input/ChaseCamera.java