| Top |
| GrxEvent * | grx_event_new () |
| gboolean | grx_events_pending () |
| GrxEvent * | grx_event_peek () |
| GrxEvent * | grx_event_get () |
| void | grx_event_put () |
| GrxEvent * | grx_event_copy () |
| void | grx_event_free () |
| GrxEventType | grx_event_get_event_type () |
| GrxModifierFlags | grx_event_get_modifiers () |
| GrxDevice * | grx_event_get_device () |
| GrxKey | grx_event_get_keysym () |
| gunichar | grx_event_get_keychar () |
| guint32 | grx_event_get_keycode () |
| void | grx_event_get_coords () |
| guint32 | grx_event_get_button () |
| void | (*GrxEventHandlerFunc) () |
| GSource * | grx_event_handler_source_new () |
| guint | grx_event_handler_add () |
gboolean
grx_events_pending (void);
Checks if there are any events in the queue.
GrxEvent *
grx_event_peek (void);
Gets the first event in the queue, but does not remove the event from the queue.
GrxEvent *
grx_event_get (void);
Gets the first event in the queue, and removes that event from the queue.
Free the event with grx_event_free().
void
grx_event_put (GrxEvent *event);
Adds a copy of event
to the end of the queue.
GrxEventType
grx_event_get_event_type (GrxEvent *event);
Gets the type of event.
GrxModifierFlags
grx_event_get_modifiers (GrxEvent *event);
Gets the modifier keys for the event.
Events that do not support modifier keys will always return 0.
GrxDevice *
grx_event_get_device (GrxEvent *event);
Gets the device associated with the event.
GrxKey
grx_event_get_keysym (GrxEvent *event);
Gets the key symbol for a key event.
gunichar
grx_event_get_keychar (GrxEvent *event);
Gets the unicode character for a key event.
guint32
grx_event_get_keycode (GrxEvent *event);
Gets the platform dependant key code for the event.
void grx_event_get_coords (GrxEvent *event,gint *x,gint *y);
Gets the screen coordinates of an event.
x
and y
are set to -1 if event
is not a GrxButtonEvent, GrxMotionEvent
or GrxTouchEvent.
guint32
grx_event_get_button (GrxEvent *event);
Gets the button for a button event
void (*GrxEventHandlerFunc) (GrxEvent *event,gpointer user_data);
Specifies the type of function passed to grx_event_handler_add().
GSource *
grx_event_handler_source_new (void);
Creates a new source that will be dispatched when events occur.
The source will not initially be associated with any GMainContext and must
be added to one with g_source_attach() before it will be executed. The
callback function (set with g_source_set_callback()) is expected to be a
GrxEventHandlerFunc.
Generally, you will want to use grx_event_handler_add() instead.
guint grx_event_handler_add (GrxEventHandlerFunc callback,gpointer user_data,GDestroyNotify notify);
Creates a new event source and adds it to the default main context.
Indicates the type of event.
|
indicates there is no event |
||
|
application activated event, for example, this is triggered by console switching by the linuxfb video driver or when using a graphical desktop driver such as gtk3, this is triggered when the window becomes the active window on the desktop window is the active window |
||
|
application deactivated event, for example, this is triggered by console switching by the linuxfb video driver or when using a graphical desktop driver such as gtk3, this is triggered when the window is no longer the active window on the desktop |
||
|
application request to quit event, for example, this is triggered the window is closed in a desktop application |
||
|
key press event |
||
|
key release event |
||
|
pointer (mouse) motion event |
||
|
button press event |
||
|
button release event |
||
|
button double-press event |
||
|
begin touch event |
||
|
touch motion event |
||
|
end touch event |
||
|
cancel touch event |
typedef struct {
GrxEventType type;
GrxKey keysym;
gunichar unichar;
guint32 code;
GrxModifierFlags modifiers;
GrxDevice *device;
} GrxKeyEvent;
Structure that holds information about a keyboard key event.
GrxEventType |
|
|
GrxKey |
the key symbol (translated using keymap) |
|
gunichar |
the UTF-32 character |
|
guint32 |
the platform dependent raw key code |
|
GrxModifierFlags |
modifier key flags |
|
GrxDevice * |
the originating device |
typedef struct {
GrxEventType type;
gint32 x;
gint32 y;
GrxModifierFlags modifiers;
GrxDevice *device;
} GrxMotionEvent;
Structure that holds information about a pointer motion event.
GrxEventType |
|
|
gint32 |
the pointer position along the x axis |
|
gint32 |
the pointer position along the y axis |
|
GrxModifierFlags |
modifier key flags |
|
GrxDevice * |
the originating device |
typedef struct {
GrxEventType type;
guint32 button;
gint32 x;
gint32 y;
GrxModifierFlags modifiers;
GrxDevice *device;
} GrxButtonEvent;
Structure that holds information about a pointer button press event.
GrxEventType |
|
|
guint32 |
the platform dependent button code |
|
gint32 |
the pointer position along the x axis |
|
gint32 |
the pointer position along the y axis |
|
GrxModifierFlags |
modifier key flags |
|
GrxDevice * |
the originating device |
typedef struct {
GrxEventType type;
gint32 id;
gint32 x;
gint32 y;
GrxModifierFlags modifiers;
GrxDevice *device;
} GrxTouchEvent;
Structure that holds information about a touch event.
GrxEventType |
|
|
gint32 |
the touch point id (for multi-touch devices) |
|
gint32 |
the X coordinate of the touch event |
|
gint32 |
the Y coordinate of the touch event |
|
GrxModifierFlags |
modifier key flags |
|
GrxDevice * |
the originating device |
A union of all event types.
GrxEventType |
the type of the event |
|
GrxKeyEvent |
the event as GrxKeyEvent |
|
GrxMotionEvent |
the event as GrxMotionEvent |
|
GrxButtonEvent |
the event as GrxButtonEvent |
|
GrxTouchEvent |
the event as GrxTouchEvent |