Main Page Modules Alphabetical List Compound List File List Compound Members File Members

# pgEvent Struct Reference
[Constants and Data Types]

Generic PicoGUI event structure. More...

`#include <client_c.h>`

List of all members.

## Public Attributes
s16 | type
| Event type, a PG_WE_* or PG_NWE_* constant.
pghandle | from
| The widget the event was recieved from (if applicable).
void * | extra
| Extra data passed to the event handler via pgBind.
union {
u32 param
struct {
s16 w
s16 h
} size
struct {
s16 mods
s16 key
} kbd
struct {
s16 x
s16 y
s16 btn
s16 chbtn
} pntr
struct {
u32 size
char * pointer
pg_client_trigger * trigger
} data
} | e
| Event-specific parameters.

## Detailed Description

Generic PicoGUI event structure.

The pgEvent structure can describe any PicoGUI event. A pointer to a pgEvent structure is the standard way of representing an event in PicoGUI.

The type, from, and extra members are valid in any event. The union, e, contains possible formats the event's parameters may take. Only one is valid, and this depends on the type of event. For example, if `event->type == PG_WE_PNTR_DOWN`, `event->e.pntr` is valid and the mouse coordinates can be found in `event->e.pntr.x` and `event->e.pntr.y` .

See also:
  pgBind, pgGetEvent

## Member Data Documentation

s16 pgEvent::btn

| Bitmask of pressed buttons, left button is bit 0.

s16 pgEvent::chbtn

| Bitmask of buttons changed since last event.

struct { ... } pgEvent::data

| Streamed data, from the PG_WE_DATA event.

union { ... } pgEvent::e

| Event-specific parameters.

void* pgEvent::extra

| Extra data passed to the event handler via pgBind.

pghandle pgEvent::from

| The widget the event was recieved from (if applicable).

s16 pgEvent::h

struct { ... } pgEvent::kbd

| Modifiers and key, for keyboard events.

s16 pgEvent::key

| For PG_WE_KBD_CHAR, an ASCII/Unicode character. For PG_WE_KBD_KEYUP and PG_WE_KBD_KEYDOWN, it is a PGKEY_* constant

s16 pgEvent::mods

| PGMOD_* constants logically or'ed together.

u32 pgEvent::param

| The generic parameter. Currently unused.

struct { ... } pgEvent::pntr

| Pointing device information, for PG_WE_PNTR_* and PG_NWE_PNTR_* events.

char* pgEvent::pointer

| Allocated and freed by the client library. It is only valid until the event handler returns or the client calls pgGetEvent

u32 pgEvent::size

struct { ... } pgEvent::size

| Width and height, for PG_WE_BUILD and PG_WE_RESIZE.

union pg_client_trigger* pgEvent::trigger

| Client-side representation of a pgserver trigger, for client-side input filters.

s16 pgEvent::type

| Event type, a PG_WE_* or PG_NWE_* constant.

s16 pgEvent::w

s16 pgEvent::x

s16 pgEvent::y

The documentation for this struct was generated from the following file:

- /home/micah/picogui/pg1/client/c/include/picogui/client_c.h