Controlling the Mouse

Using the IRender4 and the _ITerraExplorerEvents4 interfaces, the client application can interact with the mouse.

 

IRender4 manages general mouse functionalities. The SetMouseInputMode() method allows you to change the behavior of the mouse, and determine what happens when the user clicks the mouse on the 3D window. You can then define your own custom mouse cursor using the SetMouseCursor() method. Using the GetMouseInfo() method provides the current mouse position and the pressed buttons. You can then use the ScreenToWorld() to convert the screen coordinates to the real world coordinate, and determine if an object was selected by the mouse.

 

_ITerraExplorerEvents4 provides notification for mouse events. You can assign your application to monitor specific mouse events and choose to override TerraExplorer’s default action. For example, using the OnLButtonDown() event, you can receive a notification each time the user clicks the mouse on the 3D window.

 

See:Working with Mouse Events” for an example code in VBScript.