.. role:: ts-api-decorator

################
NavigationConfig
################

.. js:module:: cee
   :noindex:

.. container:: ts-api-section

   .. js:class:: NavigationConfig

      Navigation configuration for a view.

      Specify how mouse and touch input should be used to navigate the view (move the camera).

      Note: To use the right mouse button (either rightMouseButton or leftAndRightMouseButtons), you
      need to disable the default context menu in the browser (see example below).

      **Example on how to configure "Envision style" navigation:**


      .. code-block::


         // Disable context menu - Required for enableMouseButtonTracking
         canvas.addEventListener("contextmenu", (event) => { event.preventDefault()});

         // Enable mouse tracking (so we can use leftAndRightMouseButtons)
         viewer.enableMouseButtonTracking(true);

         // Envision style navigation
         const navConfig = view.navigation.config;
         navConfig.leftMouseButton.noModifier =cee.NavigationType.PAN;
         navConfig.rightMouseButton.noModifier =cee.NavigationType.ROTATE;
         navConfig.leftAndRightMouseButtons.noModifier =cee.NavigationType.WALK;
         navConfig.wheelOrPinch = cee.NavigationType.WALK;




.. container:: api-index-section

   .. rubric:: Properties

   .. rst-class:: api-index-list-item api-kind-property api-parent-kind-interface

   * :js:attr:`~cee.NavigationConfig.invertWalkZoom`
   * :js:attr:`~cee.NavigationConfig.invertWheel`
   * :js:attr:`~cee.NavigationConfig.leftAndRightMouseButtons`
   * :js:attr:`~cee.NavigationConfig.leftMouseButton`
   * :js:attr:`~cee.NavigationConfig.middleMouseButton`
   * :js:attr:`~cee.NavigationConfig.oneFinger`
   * :js:attr:`~cee.NavigationConfig.rightMouseButton`
   * :js:attr:`~cee.NavigationConfig.twoFinger`
   * :js:attr:`~cee.NavigationConfig.wheelOrPinch`





------------

Properties
==========

.. container:: ts-api-section

   .. js:attribute:: NavigationConfig.invertWalkZoom

      :type: boolean

      Invert zoom or walk. If true, camera will zoom out if mouse is moved up

      Default is false



.. container:: ts-api-section

   .. js:attribute:: NavigationConfig.invertWheel

      :type: boolean

      Invert the zoom direction of the mouse wheel

      Default is false



.. container:: ts-api-section

   .. js:attribute:: NavigationConfig.leftAndRightMouseButtons

      :type: NavigationMouseButtonConfig

      Navigation config when both left and right mouse buttons are pressed.

      Default is NONE for all modifier states.

      Note: To use the leftAndRightMouseButtons you have to enable mouse tracking in the viewer.
      See ``Viewer.enableMouseButtonTracking``. This again requires the browser context menu to be disabled



.. container:: ts-api-section

   .. js:attribute:: NavigationConfig.leftMouseButton

      :type: NavigationMouseButtonConfig

      Navigation config for left mouse button.

      Default is

      -  no modifiers -> ROTATE
      -  shift pressed -> WALK
      -  ctrl or cmd pressed -> PAN



.. container:: ts-api-section

   .. js:attribute:: NavigationConfig.middleMouseButton

      :type: NavigationMouseButtonConfig

      Navigation config for middle mouse button.

      Default is NONE for all modifier states.



.. container:: ts-api-section

   .. js:attribute:: NavigationConfig.oneFinger

      :type: NavigationType

      Navigation type to use for one finger dragging.

      Default is ROTATE



.. container:: ts-api-section

   .. js:attribute:: NavigationConfig.rightMouseButton

      :type: NavigationMouseButtonConfig

      Navigation config for right mouse button.

      Default is NONE for all modifier states.



.. container:: ts-api-section

   .. js:attribute:: NavigationConfig.twoFinger

      :type: NavigationType

      Navigation type to use for two finger dragging.

      Default is PAN



.. container:: ts-api-section

   .. js:attribute:: NavigationConfig.wheelOrPinch

      :type: NavigationType

      Navigation type to use for mouse wheel/touch screen pinch events.

      Default is WALK



