Multipipe SDK 3.2 Reference

Name

MPKEvent - MPKEvent functional interface.

Header File

#include <mpk/event.h>

Synopsis

Fields Access

void* mpkEventGetData(MPKEvent* event);

Description

The MPKEvent data structure encapsulates an X11 event. It provides convenience functions decoding the data in the corresponding XEvent. Note that the MPKEvent is freed automatically by MPK, so the pointer to one MPKEvent should not be stored within the application.

Function descriptions

Fields Access

mpkEventGetData returns the event specific data. Currently, this function returns a pointer to an MPKEventXData structure, containing:


    typedef struct
    {
        struct  { int key, ctrl, shft, state; } keyboard;
        struct  { int left, middle, right; } button;
        struct  { int x, y, dx, dy, xref, yref; } mouse;

        XEvent  *x;
    }
    MPKEventXData;

keyboard.key contains the KeySym value of the last modified key, as returned by XLookupString(3X11). keyboard.ctrl and keyboard.shft are either TRUE or FALSE depending on the state information of the last modified key. keyboard.state contains either MPK_RELEASE or MPK_PRESS, depending on the key state.

button.left, button.middle and middle.right fields contain either MPK_RELEASE or MPK_PRESS, depending on the mouse-button state.

mouse.x and mouse.y fields contain the current mouse position, while mouse.xref and mouse.yref contain the last registered mouse position, and mouse.dx and mouse.dy contain the incremental variation of the mouse position.