setInputMode Method

Sets the input mode.

setInputMode(inputMode, [cursorURL], [usePanBars]);

 

Parameter

Description

inputMode

Can be one of the following: sgInputModeFreeFlight, sgInputModeComClient. See SGWorld event onInputModeChanged for more details

cursorURL

Optional, default: undefined

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

usePanBars

Optional, default: false.

If the input mode is sgInputModeComClient, this parameter indicates if the 3D window displays the pan bars on the sides

Return Value

If the method succeeds, the return value is true. If the method fails, the return value is false. SGWorld.lastError contains the failure reason.

Remarks

The Skyline Globe Control has a default way to handle the user mouse input. Different input modes allow the user to control the mouse behavior. For example, in free flight mode, dragging the mouse in the 3D window drags the terrain in that direction. It is sometimes useful to implement a different behavior. For this purpose, set the mouse input mode to sgInputModeComClient. This will inform the control not to handle user mouse input and it will assume that the client of the control will do this (using the SGWorld various mouse events). When this is the case, turning on the 3D window pan bars (by setting the usePanBars flag to true), will make it easier for the user to control the camera even though the regular mouse inputs are not handled by the control.