Data associated with a pointer event


typedef struct Ph_ev_ptr_data {
    PhPoint_t           pos;
    unsigned short      buttons;
    unsigned short      button_state;
    unsigned char       click_count;
    unsigned char       flags;
    short               z;
    unsigned long       key_mods;
    unsigned long       zero;
} PhPointerEvent_t;


The PhPointerEvent_t structure holds the data associated with all pointer events:

For more information, see PhEvent_t.

The members of PhPointerEvent_t include:

The untranslated, absolute position of the current pointer focus. As a rule, you should use the event's rectangle set to determine coordinate positions. However, for situations that demand absolute coordinates (for example, calibrating a touchscreen), you can use pos.
Indicates which buttons the user pressed or released, depending on the event. This is a combination of:
The current state of all the buttons (i.e. which buttons are pressed). This is a combination of the same bits as buttons.
The number of clicks (for example, a value of 2 indicates a double-click). See the Ph_EV_RELEASE_ENDCLICK subtype for Ph_EV_BUT_RELEASE.
Indicates that the z field is valid.
Can be used with touchscreens to indicate touch pressure.
The modifier keys that are currently pressed. This is a combination of:

If the Shift key is pressed, the Shift modifier is on; if it's released, the Shift modifier is off. Because some keys occur twice on the keyboard, a key release doesn't guarantee that the corresponding modifier is off — the matching key may still be pressed.



See also:

PhEvent_t, PhKeyEvent_t

Events chapter of the Photon Programmer's Guide