MAV_keyboardEvent(3)

NAME
MAV_keyboardEvent - Keyboard event.

LEVEL
Maverik Level 1

SYNTAX

 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;

DESCRIPTION
The keyboard event data structure, MAV_keyboardEvent, is passed to the application supplied callback function, set with the @mav_callbackKeyboardSet function, upon keyboard events and details that event. window in which event occurred. position of mouse relative to window origin when event occured. as (x, y) but relative to root window the line from the eye point through the world position of the mouse when the keyboard event occured. MAV_TRUE if line intersects an object, MAV_FALSE otherwise. the object intersected by the line (if any). the details of any object intersection. ASCII value of key pressed an array containing the status (MAV_PRESSED or MAV_RELEASED) of the various keyboard modifiers (e.g. MAV_MODIFIER_SHIFT, MAV_MODIFIER_CTRL, MAV_MODIFIER_ALT). MAV_PRESSED if key down event, MAV_RELEASED otherwise

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.