Home > Working with SGWorld > Window (IWindow6) > SetInputMode

SetInputMode

This method determines the input mode of the mouse. Different input modes allow you to control the behavior of the mouse. For example, in free flight mode clicking with the mouse on the various areas of the 3D Window, changes the camera’s yaw or tilt. This makes it hard to click a point on the terrain to place an object. Instead you can use the COM client mode that does not change the camera position.

.

JavaScript

 

SetInputMode(

      InputMode,

      cursorURL,

      usePanBars)

 

C#

 

void SetInputMode(

      MouseInputMode InputMode,

      string cursorURL = "",

      bool usePanBars = false)

 

C++

 

HRESULT SetInputMode(

      MouseInputMode InputMode,

      BSTR cursorURL,

      VARIANT_BOOL usePanBars) 

 

Parameters

InputMode

Can be one of the following:

·         MI_FREE_FLIGHT = 0

·         MI_COM_CLIENT = 1

·         MI_CONTROLLED_FLIGHT = 2

·         MI_EDIT = 3

·         MI_MEASUREMENT = 4

cursorURL

If the input mode is MI_COM_CLIENT, this parameter can specify the URL of a cursor to be displayed on the 3D Window

usePanBars

If the input mode is MI_COM_CLIENT, this parameter indicates if the 3D Window displays the pan bars on the sides.

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list, as well as the following value:

TE_E_RENDER_WRONGINPUTMODE - Mouse input mode must be MI_COM_CLIENT for this method to take effect.