function createMorphHandler(transitioner, completeMorphFunction) {
  if (transitioner._scene.completeMorphOnUserInput) {
    transitioner._morphHandler = new ScreenSpaceEventHandler(
      transitioner._scene.canvas,
    );

    const completeMorph = function () {
      transitioner._morphCancelled = true;
      transitioner._scene.camera.cancelFlight();
      completeMorphFunction(transitioner);
    };
    transitioner._completeMorph = completeMorph;
    transitioner._morphHandler.setInputAction(
      completeMorph,
      ScreenSpaceEventType.LEFT_DOWN,
    );
    transitioner._morphHandler.setInputAction(
      completeMorph,
      ScreenSpaceEventType.MIDDLE_DOWN,
    );
    transitioner._morphHandler.setInputAction(
      completeMorph,
      ScreenSpaceEventType.RIGHT_DOWN,
    );
    transitioner._morphHandler.setInputAction(
      completeMorph,
      ScreenSpaceEventType.WHEEL,
    );
  }
}
Once an object is destroyed, it should not be used; calling any function other than
<code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,
assign the return value (<code>undefined</code>) to the object as done in the example.

@exception {DeveloperError} This object was destroyed, i.e., destroy() was called.

@example
transitioner = transitioner && transitioner.destroy();