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,

       AllowDrag)

 

C#

 

void SetInputMode(

       MouseInputMode InputMode,

       string cursorURL = "",

       bool AllowDrag = false)

 

C++

 

HRESULT SetInputMode(

       MouseInputMode InputMode,

       BSTR cursorURL,

       VARIANT_BOOL AllowDrag) 

 

Parameters

InputMode

Can be one of the following:

·          MI_FREE_FLIGHT                             = 0

·          MI_COM_CLIENT                             = 1

Note:    The other three modes returned by GetInputMode can only be set from the TerraExplorer GUI.

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.

AllowDrag

This parameter indicates whether the 3D Window can be moved by dragging it to another position on the screen.

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.