typedef struct { MAV_window *win; int x; int y; int root_x; int root_y; MAV_line line; int intersects; MAV_object *obj; MAV_objectIntersection objint; int key; int modifiers[MAV_MODIFIER_MAX]; int movement; } MAV_keyboardEvent;
The MAV_object which is passed as the first parameter to the event callback function may well be different than obj stored in this data structure since the former is always an object of the same type as the callback was registered for. Therefore, event callbacks registered for non-object classes such as mav_class_any will receive a dummy object (in this case mav_object_any) as their first parameters. No interpretation should be made of these objects by the application. However, the obj field always contains the object which the mouse was pointing at when the event occurred regardless of how the callback function was registered.