[ Compact ]
public class Event
The Event struct contains a union of all of the event structs, and allows access to the data fields in a number of
The event type is always the first field in all of the event structs, and can always be accessed with the following code, no matter what type
of event it is:
type = event->type;
To access other fields of the event structs, the pointer to the event can be cast to the appropriate event struct pointer, or the union member
name can be used. For example if the event type is BUTTON_PRESS then
the x coordinate of the button press can be accessed with:
x = ((GdkEventButton*)event)->x;
x = event->button.x;
- public static Event @get ()
Checks all open displays for a Event to process,to
be processed on, fetching events from the windowing system if necessary.
- public static void handler_set (owned EventFunc func)
Sets the function to call to handle all events from GDK.
- public static Event peek ()
If there is an event waiting in the event queue of some open display,
returns a copy of it.
- public static void request_motions (EventMotion event)
Request more motion notifies if
event is a motion notify hint
- public Event copy ()
Copies a Event, copying or incrementing the
reference count of the resources associated with it (e.g. Window's and strings).
- public void free ()
Frees a Event, freeing or decrementing any
resources associated with it.
- public bool get_axis (AxisUse axis_use, out double value)
Extract the axis value for a particular axis use from an event structure.
- public bool get_button (out uint button)
Extract the button number from an event.
- public bool get_click_count (out uint click_count)
Extracts the click count from an event.
- public bool get_coords (out double x_win, out double y_win)
Extract the event window relative x/y coordinates from an event.
- public weak Device get_device ()
If the event contains a "device" field, this function will return it, else
it will return
- public bool get_keycode (out uint16 keycode)
Extracts the hardware keycode from an event.
- public bool get_keyval (out uint keyval)
Extracts the keyval from an event.
- public bool get_root_coords (out double x_root, out double y_root)
Extract the root window relative x/y coordinates from an event.
- public weak Screen get_screen ()
Returns the screen for the event.
- public bool get_scroll_deltas (out double delta_x, out double delta_y)
Retrieves the scroll deltas from a Event
- public bool get_scroll_direction (out ScrollDirection direction)
Extracts the scroll direction from an event.
- public weak Device get_source_device ()
This function returns the hardware (slave)
Device that has triggered the event, falling back to the virtual (master)
device (as in get_device) if the event wasn't caused by interaction with a
- public bool get_state (out ModifierType state)
If the event contains a "state" field, puts that field in
- public uint32 get_time ()
Returns the time stamp from
event, if there is one; otherwise
- public void put ()
Appends a copy of the given event onto the front of the event queue for
- public void set_device (Device device)
Sets the device for
- public void set_screen (Screen screen)
Sets the screen for
- public void set_source_device (Device device)
Sets the slave device for
- public bool triggers_context_menu ()
This function returns whether a
EventButton should trigger a context menu, according to platform conventions.