.. role:: clio-inherited
   :class: clio-flag clio-flag-inherited


##################
SpaceMouseOperator
##################

.. js:class:: Operators.SpaceMouseOperator

   Provide camera movement for the 3Dconnexion SpaceMouse.
   
   
   Index
   =====
   
   .. rubric:: Constructors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~Operators.SpaceMouseOperator.constructor`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~Operators.SpaceMouseOperator.addMapping`
   * :js:meth:`~Operators.SpaceMouseOperator.clearMapping`
   * :js:meth:`~Operators.SpaceMouseOperator.connect`
   * :js:meth:`~Operators.SpaceMouseOperator.setMapping`
   
   




Constructors
============

.. js:method:: Operators.SpaceMouseOperator.constructor

   .. rst-class:: sig-pretty-signature
   
      | SpaceMouseOperator(**viewer**\ : :js:class:`~IWebViewer`\ , **view**\ : :js:class:`~IView`\ ): :js:class:`SpaceMouseOperator <Operators.SpaceMouseOperator>`
   
   **Parameters**
   
      **viewer**\ : :js:class:`~IWebViewer`
   
      **view**\ : :js:class:`~IView`
   
   
   **Returns**\ : :js:class:`SpaceMouseOperator <Operators.SpaceMouseOperator>`
   





Methods
=======

.. js:method:: Operators.SpaceMouseOperator.addMapping

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | addMapping(**button**\ : :js:data:`~Button`\ , **modifier**\ : :js:data:`~KeyModifiers`\ ?): *void*
   
   Adds a button and key modifier mapping for the operator. If no mapping is provided, all combinations are considered valid. All mappings require a mouse button, but a key modifier is optional.
   
   **Parameters**
   
      **button**\ : :js:data:`~Button`
   
      **modifier**\ : :js:data:`~KeyModifiers` = KeyModifiers.None
   
   
   **Returns**\ : *void*
   



.. js:method:: Operators.SpaceMouseOperator.clearMapping

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | clearMapping(): *void*
   
   Clears any button and key modifier mappings for the operator.
   
   **Returns**\ : *void*
   



.. js:method:: Operators.SpaceMouseOperator.connect

   .. rst-class:: sig-pretty-signature
   
      | connect(): *void*
   
   Connect to the space mouse. To be successful, this method should be called in the sceneReady callback. If you want to connect at a later time, the canvas where the mouse is to be used must have focus.
   
   Note: If this is called but the 3d connexion software is not running, a connection error will be shown in the console.
   
   **Returns**\ : *void*
   



.. js:method:: Operators.SpaceMouseOperator.setMapping

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | setMapping(**button**\ : :js:data:`~Button`\ , **modifier**\ : :js:data:`~KeyModifiers`\ ?): *void*
   
   Sets the button and key modifier mapping for the operator.
   
   **Parameters**
   
      **button**\ : :js:data:`~Button`
   
      **modifier**\ : :js:data:`~KeyModifiers` = KeyModifiers.None
   
   
   **Returns**\ : *void*
   





