![]() |
• System Utilities | ||||||||||||||||||||||||||||
|
API Links
Developer Links
|
class MouseEventHandlerDefined in:
The C4Engine.hMouseEventHandler class encapsulates a mouse event handler function.
Definition
Constructor
Parameters
Description
The MouseEventHandler class encapsulates a procedure that is invoked when a mouse event occurs. Once an instance of the MouseEventHandler class has been constructed, it can be installed by calling the Engine::InstallMouseEventHandler function.When a mouse event occurs, the procedures corresponding to all installed mouse event handlers are invoked. The HandlerProc type is defined as follows.
eventType field of the MouseEventData structure specifies what type of mouse event occurred and can be one of the following values.
mousePosition field of the MouseEventData structure specifies the screen coordinates at which the mouse event occurred. For the kEventMouseWheel event, the y member of the mousePosition field specifies how far the wheel was moved (positive or negative), and the x member is undefined.For the kEventMultiaxisMouseTranslation and kEventMultiaxisMouseRotation events, the mousePosition field contains the 3D translation or rotation rate information. For the kEventMultiaxisMouseButtonState event, the eventFlags field of the MouseEventData structure contains the state of all 32 possible buttons, with the lowest bit representing button 1 and the highest bit representing button 32.The cookie parameter is the value passed to the MouseEventHandler constructor.The value returned by the handler specifies whether the mouse event was successfully handled. If the handler returns true, then the mouse event is considered handled, and no further mouse event handlers will be called for the same event. If the handler returns false, then the event is passed to the next mouse event handler.A mouse event handler is uninstalled by destroying its associated class instance. Base Classes
|