.. role:: ts-api-decorator

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

.. js:module:: Operators
   :noindex:

.. container:: ts-api-section

   .. js:class:: SpaceMouseOperator

      Provide camera movement for the 3Dconnexion SpaceMouse.



.. container:: api-index-section

   .. rubric:: Constructors

   .. rst-class:: api-index-list-item api-kind-constructor api-parent-kind-class

   * :js:meth:`~Operators.SpaceMouseOperator.constructor`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~Operators.SpaceMouseOperator.addMapping`
   * :js:meth:`~Operators.SpaceMouseOperator.clearMapping`
   * :js:meth:`~Operators.SpaceMouseOperator.connect`
   * :js:meth:`~Operators.SpaceMouseOperator.setMapping`





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

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

.. container:: ts-api-section

   .. js:function:: SpaceMouseOperator.constructor( viewer, view)

      :param viewer: None
      :type viewer: WebViewer
      :param view: None
      :type view: View


      :rtype: SpaceMouseOperator



Methods
=======

.. rst-class:: ts-api-section

addMapping
----------

.. js:method:: SpaceMouseOperator.addMapping( button, modifier)

   :param button: None
   :type button: Button
   :param modifier: None
   :type modifier: KeyModifiers


   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.


   :rtype: void

.. rst-class:: ts-api-section

clearMapping
------------

.. js:method:: SpaceMouseOperator.clearMapping()



   Clears any button and key modifier mappings for the operator.


   :rtype: void

.. rst-class:: ts-api-section

connect
-------

.. js:method:: SpaceMouseOperator.connect()



   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.


   :rtype: void

.. rst-class:: ts-api-section

setMapping
----------

.. js:method:: SpaceMouseOperator.setMapping( button, modifier)

   :param button: None
   :type button: Button
   :param modifier: None
   :type modifier: KeyModifiers


   Sets the button and key modifier mapping for the operator.


   :rtype: void

