MAV_keyboardEvent - Keyboard event.

[ Maverik Level 1 typedefs ]

#

MAV_keyboardEvent

## Summary

Keyboard event.

## 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.

- `win` window in which event occurred.

- `x`, `y` position of mouse relative to window origin when event occured.

- `root_x`, `root_y` as (`x`, `y`) but relative to root window

- `line` the line from the eye point through the world position of the mouse when the keyboard event occured.

- `intersects` `MAV_TRUE` if line intersects an object, `MAV_FALSE` otherwise.

- `obj` the object intersected by the line (if any).

- `objint` the details of any object intersection.

- `key` ASCII value of key pressed

- `movement` `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.

Back to the index page.