HDK
|
Houdini offers custom mouse event hooks that allow you to augment or replace mouse event handling in the Houdini viewport. These hooks, in combination with the custom viewport rendering hooks, provide a great amount of control over the display and functionality of the Houdini viewport.
Mouse event hooks are most commonly used in conjunction with scene render hooks to allow interaction with custom scene elements.
Mouse hooks replace or augument handling of mouse events, such as button presses, button releases, mouse movement, mouse wheel scrolling, double clicks, and RMB menu popups.
To install a mouse hook, derive a class from DM_MouseHook and install it to the DM_EventTable. The DM_MouseHook acts as an object factory for a class derived from DM_MouseEventHook.
There is a simple mouse hook example:
HDK_Sample::DM_GreedyMouseHook
: Greedily consumes all mouse events, effectively crippling the viewport. A very basic beginner example. (DM_GreedyMouseHook.C)DM_MouseEventHook has several virtual methods that take a UI_Event object pointer as an argument. This object encapsulates a lot of useful state information about the mouse event. For example, the type of event can be found in UI_Event::reason, a member of type UI_Reason.
Also of interest is UI_Event::state.