A Gdk.Event.Gdk_Event contains a union of all of the event types, and allows access to the data fields in a number of ways.
The event type is always the first field in all of the event types, and can always be accessed with the following code, no matter what type of event it is:
GdkEvent *event;
GdkEventType type;
type = event->type;
To access other fields of the event, the pointer to the event can be cast to the appropriate event type, or the union member name can be used. For example if the event type is Gdk.Event.Button_Press then the x coordinate of the button press can be accessed with:
GdkEvent *event;
gdouble x;
x = ((GdkEventButton*)event)->x;
or:
GdkEvent *event;
gdouble x;
x = event->button.x;
<group>Gdk, the low-level API</group>
All_Events_Mask : constant Gdk_Event_Mask := 67108862;
Button1_Motion_Mask : constant Gdk_Event_Mask := 32;
Button2_Motion_Mask : constant Gdk_Event_Mask := 64;
Button3_Motion_Mask : constant Gdk_Event_Mask := 128;
Button_Middle : constant Gint := 2;
The primary button is typically the left mouse button, or the right button in a left-handed setup. The secondary button is the other one.
Button_Motion_Mask : constant Gdk_Event_Mask := 16;
Button_Press_Mask : constant Gdk_Event_Mask := 256;
Button_Primary : constant Gint := 1;
The primary button is typically the left mouse button, or the right button in a left-handed setup. The secondary button is the other one.
Button_Release_Mask : constant Gdk_Event_Mask := 512;
Button_Secondary : constant Gint := 3;
The primary button is typically the left mouse button, or the right button in a left-handed setup. The secondary button is the other one.
function Copy (Event : Gdk_Event) return Gdk_Event
Copies a Gdk.Event.Gdk_Event, copying or incrementing the reference count of the resources associated with it (e.g. Gdk.Gdk_Window's and strings).
a copy of Event. The returned Gdk.Event.Gdk_Event should be freed with Gdk.Event.Free.
Double_Button_Press : constant Gdk_Event_Type := Gdk_2button_Press;
Enter_Notify_Mask : constant Gdk_Event_Mask := 4096;
function Events_Pending return Boolean
Checks if any events are ready to be processed for any display.
True if any events are pending.
Exposure_Mask : constant Gdk_Event_Mask := 2;
Focus_Change_Mask : constant Gdk_Event_Mask := 16384;
procedure Free (Event : Gdk_Event)
Frees a Gdk.Event.Gdk_Event, freeing or decrementing any resources associated with it. Note that this function should only be called with events returned from functions such as Gdk.Event.Peek, Gdk.Event.Get, Gdk.Event.Copy and gdk_event_new.
function From_Address (C : System.Address) return Gdk_Event
Convert a C handler to the matching Event structure.
function From_Object_Free (B : access Gdk_Event_Any) return Gdk_Event_Any
Contains the fields which are common to all event structs. Any event pointer can safely be cast to a pointer to a Gdk.Event.Gdk_Event_Any to access these fields.
function From_Object_Free (B : access Gdk_Event_Button) return Gdk_Event_Button
Used for button press and button release events. The Type field will be one of Gdk.Event.Button_Press, Gdk.Event.Gdk_2button_Press, Gdk.Event.Gdk_3button_Press or Gdk.Event.Button_Release,
Double and triple-clicks result in a sequence of events being received. For double-clicks the order of events will be:
Gdk.Event.Button_Press - Gdk.Event.Button_Release -
Gdk.Event.Button_Press - Gdk.Event.Gdk_2button_Press - Gdk.Event.Button_Release
Note that the first click is received just like a normal button press, while the second click results in a Gdk.Event.Gdk_2button_Press being received just after the Gdk.Event.Button_Press.
Triple-clicks are very similar to double-clicks, except that Gdk.Event.Gdk_3button_Press is inserted after the third click. The order of the events is:
Gdk.Event.Button_Press - Gdk.Event.Button_Release -
Gdk.Event.Button_Press - Gdk.Event.Gdk_2button_Press - Gdk.Event.Button_Release - Gdk.Event.Button_Press - Gdk.Event.Gdk_3button_Press - Gdk.Event.Button_Release
For a double click to occur, the second button press must occur within 1/4 of a second of the first. For a triple click to occur, the third button press must also occur within 1/2 second of the first button press.
function From_Object_Free (B : access Gdk_Event_Configure) return Gdk_Event_Configure
Generated when a window size or position has changed.
function From_Object_Free (B : access Gdk_Event_Crossing) return Gdk_Event_Crossing
Generated when the pointer enters or leaves a window.
function From_Object_Free (B : access Gdk_Event_DND) return Gdk_Event_DND
Generated during DND operations.
function From_Object_Free (B : access Gdk_Event_Expose) return Gdk_Event_Expose
Generated when all or part of a window becomes visible and needs to be redrawn.
function From_Object_Free (B : access Gdk_Event_Focus) return Gdk_Event_Focus
Describes a change of keyboard focus.
function From_Object_Free (B : access Gdk_Event_Grab_Broken) return Gdk_Event_Grab_Broken
Generated when a pointer or keyboard grab is broken. On X11, this happens when the grab window becomes unviewable (i.e. it or one of its ancestors is unmapped), or if the same application grabs the pointer or keyboard again. Note that implicit grabs (which are initiated by button presses) can also cause Gdk.Event.Gdk_Event_Grab_Broken events. Generated when a pointer or keyboard grab is broken. On X11, this happens when the grab window becomes unviewable (i.e. it or one of its ancestors is unmapped), or if the same application grabs the pointer or keyboard again. Note that implicit grabs (which are initiated by button presses) can also cause Gdk.Event.Gdk_Event_Grab_Broken events.
function From_Object_Free (B : access Gdk_Event_Key) return Gdk_Event_Key
Describes a key press or key release event.
function From_Object_Free (B : access Gdk_Event_Motion) return Gdk_Event_Motion
Generated when the pointer moves.
function From_Object_Free (B : access Gdk_Event_Owner_Change) return Gdk_Event_Owner_Change
Generated when the owner of a selection changes. On X11, this information is only available if the X server supports the XFIXES extension.
function From_Object_Free (B : access Gdk_Event_Pad_Axis) return Gdk_Event_Pad_Axis
Generated during GDK_SOURCE_TABLET_PAD interaction with tactile sensors.
function From_Object_Free (B : access Gdk_Event_Pad_Button) return Gdk_Event_Pad_Button
Generated during GDK_SOURCE_TABLET_PAD button presses and releases.
function From_Object_Free (B : access Gdk_Event_Pad_Group_Mode) return Gdk_Event_Pad_Group_Mode
Generated during GDK_SOURCE_TABLET_PAD mode switches in a group.
function From_Object_Free (B : access Gdk_Event_Property) return Gdk_Event_Property
Describes a property change on a window.
function From_Object_Free (B : access Gdk_Event_Proximity) return Gdk_Event_Proximity
Proximity events are generated when using GDK's wrapper for the XInput extension. The XInput extension is an add-on for standard X that allows you to use nonstandard devices such as graphics tablets. A proximity event indicates that the stylus has moved in or out of contact with the tablet, or perhaps that the user's finger has moved in or out of contact with a touch screen.
This event type will be used pretty rarely. It only is important for XInput aware programs that are drawing their own cursor.
function From_Object_Free (B : access Gdk_Event_Record) return Gdk_Event_Record
A Gdk.Event.Gdk_Event contains a union of all of the event types, and allows access to the data fields in a number of ways.
The event type is always the first field in all of the event types, and can always be accessed with the following code, no matter what type of event it is:
GdkEvent *event;
GdkEventType type;
type = event->type;
To access other fields of the event, the pointer to the event can be cast to the appropriate event type, or the union member name can be used. For example if the event type is Gdk.Event.Button_Press then the x coordinate of the button press can be accessed with:
GdkEvent *event;
gdouble x;
x = ((GdkEventButton*)event)->x;
or:
GdkEvent *event;
gdouble x;
x = event->button.x;
function From_Object_Free (B : access Gdk_Event_Scroll) return Gdk_Event_Scroll
Generated from button presses for the buttons 4 to 7. Wheel mice are usually configured to generate button press events for buttons 4 and 5 when the wheel is turned.
Some GDK backends can also generate "smooth" scroll events, which can be recognized by the Gdk.Event.Scroll_Smooth scroll direction. For these, the scroll deltas can be obtained with Gdk.Event.Get_Scroll_Deltas.
function From_Object_Free (B : access Gdk_Event_Selection) return Gdk_Event_Selection
Generated when a selection is requested or ownership of a selection is taken over by another client application.
function From_Object_Free (B : access Gdk_Event_Sequence) return Gdk_Event_Sequence
function From_Object_Free (B : access Gdk_Event_Setting) return Gdk_Event_Setting
Generated when a setting is modified.
function From_Object_Free (B : access Gdk_Event_Touch) return Gdk_Event_Touch
Used for touch events. Type field will be one of Gdk.Event.Touch_Begin, Gdk.Event.Touch_Update, Gdk.Event.Touch_End or Gdk.Event.Touch_Cancel.
Touch events are grouped into sequences by means of the Sequence field, which can also be obtained with Gdk.Event.Get_Event_Sequence. Each sequence begins with a Gdk.Event.Touch_Begin event, followed by any number of Gdk.Event.Touch_Update events, and ends with a Gdk.Event.Touch_End (or Gdk.Event.Touch_Cancel) event. With multitouch devices, there may be several active sequences at the same time.
function From_Object_Free (B : access Gdk_Event_Touchpad_Pinch) return Gdk_Event_Touchpad_Pinch
Generated during touchpad swipe gestures.
function From_Object_Free (B : access Gdk_Event_Touchpad_Swipe) return Gdk_Event_Touchpad_Swipe
Generated during touchpad swipe gestures.
function From_Object_Free (B : access Gdk_Event_Visibility) return Gdk_Event_Visibility
Generated when the window visibility status has changed.
function From_Object_Free (B : access Gdk_Event_Window_State) return Gdk_Event_Window_State
Generated when the state of a toplevel window changes.
type Gdk_Crossing_Mode is (
Crossing_Normal,
Crossing_Grab,
Crossing_Ungrab,
Crossing_Gtk_Grab,
Crossing_Gtk_Ungrab,
Crossing_State_Changed,
Crossing_Touch_Begin,
Crossing_Touch_End,
Crossing_Device_Switch);
Specifies the crossing mode for Gdk.Event.Gdk_Event_Crossing.
package Gdk_Crossing_Mode_Properties is
new Generic_Internal_Discrete_Property (Gdk_Crossing_Mode);
type Gdk_Event is access all Gdk_Event_Record;
type Gdk_Event_Any is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
end record;
type Gdk_Event_Button is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Time : Guint32;
X : Gdouble;
Y : Gdouble;
Axes : access Gdouble;
State : Gdk.Types.Gdk_Modifier_Type;
Button : Guint;
Device : System.Address;
X_Root : Gdouble;
Y_Root : Gdouble;
end record;
type Gdk_Event_Configure is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
X : Glib.Gint := 0;
Y : Glib.Gint := 0;
Width : Glib.Gint := 0;
Height : Glib.Gint := 0;
end record;
type Gdk_Event_Crossing is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Subwindow : Gdk.Gdk_Window;
Time : Guint32;
X : Gdouble;
Y : Gdouble;
X_Root : Gdouble;
Y_Root : Gdouble;
Mode : Gdk_Crossing_Mode;
Detail : Gdk_Notify_Type;
Focus : Boolean;
State : Gdk.Types.Gdk_Modifier_Type;
end record;
type Gdk_Event_DND is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Context : System.Address;
Time : Guint32;
X_Root : Gshort;
Y_Root : Gshort;
end record;
type Gdk_Event_Expose is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Area : Gdk.Rectangle.Gdk_Rectangle;
Region : Cairo.Region.Cairo_Region;
Count : Glib.Gint := 0;
end record;
type Gdk_Event_Focus is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Gtk_In : Gint16;
end record;
type Gdk_Event_Func is access procedure (Event : Gdk_Event);
Specifies the type of function passed to Gdk.Event.Handler_Set to handle all GDK events.
the Gdk.Event.Gdk_Event to process.
type Gdk_Event_Grab_Broken is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Keyboard : Boolean;
Implicit : Boolean;
Grab_Window : Gdk.Gdk_Window;
end record;
type Gdk_Event_Key is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Time : Guint32;
State : Gdk.Types.Gdk_Modifier_Type;
Keyval : Gdk.Types.Gdk_Key_Type;
Length : Glib.Gint := 0;
String : Gtkada.Types.Chars_Ptr;
Hardware_Keycode : Guint16;
Group : Guint8;
Is_Modifier : Guint;
end record;
type Gdk_Event_Mask is mod 2 ** Integer'Size;
A set of bit-flags to indicate which events a window is to receive. Most of these masks map onto one or more of the Gdk.Event.Gdk_Event_Type event types above.
See the [input handling overview][chap-input-handling] for details of [event masks][event-masks] and [event propagation][event-propagation].
Gdk.Event.Pointer_Motion_Hint_Mask is deprecated. It is a special mask to reduce the number of Gdk.Event.Motion_Notify events received. When using Gdk.Event.Pointer_Motion_Hint_Mask, fewer Gdk.Event.Motion_Notify events will be sent, some of which are marked as a hint (the is_hint member is True). To receive more motion events after a motion hint event, the application needs to asks for more, by calling Gdk.Event.Request_Motions.
Since GTK 3.8, motion events are already compressed by default, independent of this mechanism. This compression can be disabled with Gdk.Window.Set_Event_Compression. See the documentation of that function for details.
If Gdk.Event.Touch_Mask is enabled, the window will receive touch events from touch-enabled devices. Those will come as sequences of Gdk.Event.Gdk_Event_Touch with type Gdk.Event.Touch_Update, enclosed by two events with type Gdk.Event.Touch_Begin and Gdk.Event.Touch_End (or Gdk.Event.Touch_Cancel). Gdk.Event.Get_Event_Sequence returns the event sequence for these events, so different sequences may be distinguished.
package Gdk_Event_Mask_Properties is
new Generic_Internal_Discrete_Property (Gdk_Event_Mask);
type Gdk_Event_Motion is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Time : Guint32;
X : Gdouble;
Y : Gdouble;
Axes : access Gdouble;
State : Gdk.Types.Gdk_Modifier_Type;
Is_Hint : Gint16;
Device : System.Address;
X_Root : Gdouble;
Y_Root : Gdouble;
end record;
function Gdk_Event_New (The_Type : Gdk_Event_Type) return Gdk_Event
Creates a new event of the given type. All fields are set to 0. Since: gtk+ 2.2
a Gdk.Event.Gdk_Event_Type
type Gdk_Event_Owner_Change is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Owner : Gdk.Gdk_Window;
Reason : Gdk_Owner_Change;
Selection : Gdk.Types.Gdk_Atom;
Time : Guint32;
Selection_Time : Guint32;
end record;
type Gdk_Event_Pad_Axis is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Time : Guint32;
Group : Guint;
Index : Guint;
Mode : Guint;
Value : Gdouble;
end record;
type Gdk_Event_Pad_Button is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Time : Guint32;
Group : Guint;
Button : Guint;
Mode : Guint;
end record;
type Gdk_Event_Pad_Group_Mode is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Time : Guint32;
Group : Guint;
Mode : Guint;
end record;
type Gdk_Event_Property is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Atom : Gdk.Types.Gdk_Atom;
Time : Guint32;
State : Gdk_Property_State;
end record;
type Gdk_Event_Proximity is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Time : Guint32;
Device : System.Address;
end record;
type Gdk_Event_Record (The_Type : Gdk_Event_Type := Gdk.Event.Nothing) is record
case The_Type is
when Gdk.Event.Nothing
| Gdk.Event.Delete
| Gdk.Event.Destroy
| Gdk.Event.Map
| Gdk.Event.Unmap
| Gdk.Event.Client_Event =>
Any : Gdk_Event_Any;
when Gdk.Event.Expose
| Gdk.Event.Damage =>
Expose : Gdk_Event_Expose;
when Gdk.Event.Visibility_Notify =>
Visibility : Gdk_Event_Visibility;
when Gdk.Event.Motion_Notify =>
Motion : Gdk_Event_Motion;
when Gdk.Event.Button_Press
| Gdk.Event.Gdk_2button_Press
| Gdk.Event.Gdk_3button_Press
| Gdk.Event.Button_Release =>
Button : Gdk_Event_Button;
when Gdk.Event.Touch_Begin
| Gdk.Event.Touch_Update
| Gdk.Event.Touch_End
| Gdk.Event.Touch_Cancel =>
Touch : Gdk_Event_Touch;
when Gdk.Event.Scroll =>
Scroll : Gdk_Event_Scroll;
when Gdk.Event.Key_Press
| Gdk.Event.Key_Release =>
Key : Gdk_Event_Key;
when Gdk.Event.Enter_Notify
| Gdk.Event.Leave_Notify =>
Crossing : Gdk_Event_Crossing;
when Gdk.Event.Focus_Change =>
Focus_Change : Gdk_Event_Focus;
when Gdk.Event.Configure =>
Configure : Gdk_Event_Configure;
when Gdk.Event.Property_Notify =>
Property : Gdk_Event_Property;
when Gdk.Event.Selection_Clear
| Gdk.Event.Selection_Request
| Gdk.Event.Selection_Notify =>
Selection : Gdk_Event_Selection;
when Gdk.Event.Owner_Change =>
Owner_Change : Gdk_Event_Owner_Change;
when Gdk.Event.Proximity_In
| Gdk.Event.Proximity_Out =>
Proximity : Gdk_Event_Proximity;
when Gdk.Event.Drag_Enter
| Gdk.Event.Drag_Leave
| Gdk.Event.Drag_Motion
| Gdk.Event.Drag_Status
| Gdk.Event.Drop_Start
| Gdk.Event.Drop_Finished =>
Dnd : Gdk_Event_DND;
when Gdk.Event.Window_State =>
Window_State : Gdk_Event_Window_State;
when Gdk.Event.Setting =>
Setting : Gdk_Event_Setting;
when Gdk.Event.Grab_Broken =>
Grab_Broken : Gdk_Event_Grab_Broken;
when Gdk.Event.Touchpad_Swipe =>
Touchpad_Swipe : Gdk_Event_Touchpad_Swipe;
when Gdk.Event.Touchpad_Pinch =>
Touchpad_Pinch : Gdk_Event_Touchpad_Pinch;
when Gdk.Event.Pad_Button_Press
| Gdk.Event.Pad_Button_Release =>
Pad_Button : Gdk_Event_Pad_Button;
when Gdk.Event.Pad_Ring
| Gdk.Event.Pad_Strip =>
Pad_Axis : Gdk_Event_Pad_Axis;
when Gdk.Event.Pad_Group_Mode =>
Pad_Group_Mode : Gdk_Event_Pad_Group_Mode;
end case;
end record;
type Gdk_Event_Scroll is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Time : Guint32;
X : Gdouble;
Y : Gdouble;
State : Gdk.Types.Gdk_Modifier_Type;
Direction : Gdk_Scroll_Direction;
Device : System.Address;
X_Root : Gdouble;
Y_Root : Gdouble;
Delta_X : Gdouble;
Delta_Y : Gdouble;
Is_Stop : Guint;
end record;
type Gdk_Event_Selection is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Selection : Gdk.Types.Gdk_Atom;
Target : Gdk.Types.Gdk_Atom;
Property : Gdk.Types.Gdk_Atom;
Time : Guint32;
Requestor : Gdk.Gdk_Window;
end record;
type Gdk_Event_Sequence is new Glib.C_Proxy;
type Gdk_Event_Setting is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Action : Gdk_Setting_Action;
Name : Gtkada.Types.Chars_Ptr;
end record;
type Gdk_Event_Touch is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Time : Guint32;
X : Gdouble;
Y : Gdouble;
Axes : access Gdouble;
State : Gdk.Types.Gdk_Modifier_Type;
Sequence : Gdk_Event_Sequence;
Emulating_Pointer : Boolean;
Device : System.Address;
X_Root : Gdouble;
Y_Root : Gdouble;
end record;
type Gdk_Event_Touchpad_Pinch is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Phase : Gint8;
N_Fingers : Gint8;
Time : Guint32;
X : Gdouble;
Y : Gdouble;
Dx : Gdouble;
Dy : Gdouble;
Angle_Delta : Gdouble;
Scale : Gdouble;
X_Root : Gdouble;
Y_Root : Gdouble;
State : Gdk.Types.Gdk_Modifier_Type;
end record;
type Gdk_Event_Touchpad_Swipe is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Phase : Gint8;
N_Fingers : Gint8;
Time : Guint32;
X : Gdouble;
Y : Gdouble;
Dx : Gdouble;
Dy : Gdouble;
X_Root : Gdouble;
Y_Root : Gdouble;
State : Gdk.Types.Gdk_Modifier_Type;
end record;
type Gdk_Event_Type is (
Nothing,
Delete,
Destroy,
Expose,
Motion_Notify,
Button_Press,
Gdk_2button_Press,
Gdk_3button_Press,
…,
Pad_Group_Mode);
Specifies the type of the event.
Do not confuse these events with the signals that GTK+ widgets emit. Although many of these events result in corresponding signals being emitted, the events are often transformed or filtered along the way.
In some language bindings, the values Gdk.Event.Gdk_2button_Press and Gdk.Event.Gdk_3button_Press would translate into something syntactically invalid (eg Gdk.EventType.2ButtonPress, where a symbol is not allowed to start with a number). In that case, the aliases GDK_DOUBLE_BUTTON_PRESS and GDK_TRIPLE_BUTTON_PRESS can be used instead.
package Gdk_Event_Type_Properties is
new Generic_Internal_Discrete_Property (Gdk_Event_Type);
type Gdk_Event_Visibility is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
State : Gdk_Visibility_State;
end record;
type Gdk_Event_Window_State is record
The_Type : Gdk_Event_Type;
Window : Gdk.Gdk_Window;
Send_Event : Gint8;
Changed_Mask : Gdk_Window_State;
New_Window_State : Gdk_Window_State;
end record;
procedure Gdk_New (Event : out Gdk_Event; The_Type : Gdk_Event_Type)
Creates a new event of the given type. All fields are set to 0. Since: gtk+ 2.2
a Gdk.Event.Gdk_Event_Type
type Gdk_Notify_Type is (
Notify_Ancestor,
Notify_Virtual,
Notify_Inferior,
Notify_Nonlinear,
Notify_Nonlinear_Virtual,
Notify_Unknown);
Specifies the kind of crossing for Gdk.Event.Gdk_Event_Crossing.
See the X11 protocol specification of LeaveNotify for full details of crossing event generation.
package Gdk_Notify_Type_Properties is
new Generic_Internal_Discrete_Property (Gdk_Notify_Type);
type Gdk_Owner_Change is (
Owner_Change_New_Owner,
Owner_Change_Destroy,
Owner_Change_Close);
Specifies why a selection ownership was changed.
package Gdk_Owner_Change_Properties is
new Generic_Internal_Discrete_Property (Gdk_Owner_Change);
type Gdk_Property_State is (
Property_New_Value,
Property_Delete);
Specifies the type of a property change for a Gdk.Event.Gdk_Event_Property.
package Gdk_Property_State_Properties is
new Generic_Internal_Discrete_Property (Gdk_Property_State);
type Gdk_Scroll_Direction is (
Scroll_Up,
Scroll_Down,
Scroll_Left,
Scroll_Right,
Scroll_Smooth);
Specifies the direction for Gdk.Event.Gdk_Event_Scroll.
package Gdk_Scroll_Direction_Properties is
new Generic_Internal_Discrete_Property (Gdk_Scroll_Direction);
type Gdk_Setting_Action is (
Setting_Action_New,
Setting_Action_Changed,
Setting_Action_Deleted);
Specifies the kind of modification applied to a setting in a Gdk.Event.Gdk_Event_Setting.
package Gdk_Setting_Action_Properties is
new Generic_Internal_Discrete_Property (Gdk_Setting_Action);
type Gdk_Visibility_State is (
Visibility_Unobscured,
Visibility_Partial,
Visibility_Fully_Obscured);
Specifies the visiblity status of a window for a Gdk.Event.Gdk_Event_Visibility.
package Gdk_Visibility_State_Properties is
new Generic_Internal_Discrete_Property (Gdk_Visibility_State);
type Gdk_Window_State is mod 2 ** Integer'Size;
Specifies the state of a toplevel window.
package Gdk_Window_State_Properties is
new Generic_Internal_Discrete_Property (Gdk_Window_State);
function Get return Gdk_Event
Checks all open displays for a Gdk.Event.Gdk_Event to process,to be processed on, fetching events from the windowing system if necessary. See Gdk.Display.Get_Event.
the next Gdk.Event.Gdk_Event to be processed, or null if no events are pending. The returned Gdk.Event.Gdk_Event should be freed with Gdk.Event.Free.
function Get_Angle
(Event : Gdk_Event;
Event2 : Gdk_Event;
Angle : access Gdouble) return Boolean
If both events contain X/Y information, this function will return True and return in Angle the relative angle from Event1 to Event2. The rotation direction for positive angles is from the positive X axis towards the positive Y axis. Since: gtk+ 3.0
second Gdk.Event.Gdk_Event
return location for the relative angle between both events
True if the angle could be calculated.
procedure Get_Axis
(Event : Gdk_Event;
Axis_Use : Gdk_Axis_Use;
Value : out Gdouble)
Extract the axis value for a particular axis use from an event structure.
the axis use to look for
location to store the value found
function Get_Button (Event : Gdk_Event) return Guint
Extract the button number from an event
function Get_Center
(Event : Gdk_Event;
Event2 : Gdk_Event;
X : access Gdouble;
Y : access Gdouble) return Boolean
If both events contain X/Y information, the center of both coordinates will be returned in X and Y. Since: gtk+ 3.0
second Gdk.Event.Gdk_Event
return location for the X coordinate of the center
return location for the Y coordinate of the center
True if the center could be calculated.
procedure Get_Coords
(Event : Gdk_Event;
X_Win : out Gdouble;
Y_Win : out Gdouble)
Extract the event window relative x/y coordinates from an event.
location to put event window x coordinate
location to put event window y coordinate
function Get_Device_Tool
(Event : Gdk_Event) return Gdk.Device_Tool.Gdk_Device_Tool
If the event was generated by a device that supports different tools (eg. a tablet), this function will return a Gdk.Device_Tool.Gdk_Device_Tool representing the tool that caused the event. Otherwise, null will be returned. Note: the Gdk.Device_Tool.Gdk_Device_Tool<!-- -->s will be constant during the application lifetime, if settings must be stored persistently across runs, see Gdk.Device_Tool.Get_Serial Since: gtk+ 3.22
The current device tool, or null
function Get_Distance
(Event : Gdk_Event;
Event2 : Gdk_Event;
Distance : access Gdouble) return Boolean
If both events have X/Y information, the distance between both coordinates (as in a straight line going from Event1 to Event2) will be returned. Since: gtk+ 3.0
second Gdk.Event.Gdk_Event
return location for the distance
True if the distance could be calculated.
function Get_Event (Value : Glib.Values.GValue) return Gdk_Event
Convert a value into a Gdk_Event.
function Get_Event_Sequence (Event : Gdk_Event) return Gdk_Event_Sequence
If Event if of type Gdk.Event.Touch_Begin, Gdk.Event.Touch_Update, Gdk.Event.Touch_End or Gdk.Event.Touch_Cancel, returns the Gdk.Event.Gdk_Event_Sequence to which the event belongs. Otherwise, return null. Since: gtk+ 3.4
the event sequence that the event belongs to
function Get_Event_Type (Event : Gdk_Event) return Gdk_Event_Type
Retrieves the type of the event. Since: gtk+ 3.10
a Gdk.Event.Gdk_Event_Type
function Get_Key_Val (Event : Gdk_Event) return Gdk.Types.Gdk_Key_Type
Code of the key that was pressed (and that generated the event)
function Get_Keycode (Event : Gdk_Event) return Guint
Hardware key code of the key that was pressed
function Get_Pointer_Emulated (Event : Gdk_Event) return Boolean
event: a Gdk.Event.Gdk_Event Returns whether this event is an 'emulated' pointer event (typically from a touch event), as opposed to a real one. Since: gtk+ 3.22
True if this event is emulated
procedure Get_Root_Coords
(Event : Gdk_Event;
X_Root : out Gdouble;
Y_Root : out Gdouble)
Extract the root window relative x/y coordinates from an event.
location to put root window x coordinate
location to put root window y coordinate
function Get_Scancode (Event : Gdk_Event) return Glib.Gint
Gets the keyboard low-level scancode of a key event. This is usually hardware_keycode. On Windows this is the high word of WM_KEY{DOWN,UP} lParam which contains the scancode and some extended flags. Since: gtk+ 3.22
The associated keyboard scancode or 0
procedure Get_Scroll_Deltas
(Event : Gdk_Event;
Delta_X : out Gdouble;
Delta_Y : out Gdouble)
Retrieves the scroll deltas from a Gdk.Event.Gdk_Event See also: Gdk.Event.Get_Scroll_Direction Since: gtk+ 3.4
return location for X delta
return location for Y delta
procedure Get_Scroll_Direction
(Event : Gdk_Event;
Direction : out Gdk_Scroll_Direction)
Extracts the scroll direction from an event. If Event is not of type Gdk.Event.Scroll, the contents of Direction are undefined. If you wish to handle both discrete and smooth scrolling, you should check the return value of this function, or of Gdk.Event.Get_Scroll_Deltas; for instance:
GdkScrollDirection direction;
double vscroll_factor = 0.0;
double x_scroll, y_scroll;
if (gdk_event_get_scroll_direction (event, &direction))
{
// Handle discrete scrolling with a known constant delta;
const double delta = 12.0;
switch (direction)
{
case GDK_SCROLL_UP:
vscroll_factor = -delta;
break;
case GDK_SCROLL_DOWN:
vscroll_factor = delta;
break;
default:
// no scrolling
break;
}
}
else if (gdk_event_get_scroll_deltas (event, &x_scroll, &y_scroll))
{
// Handle smooth scrolling directly
vscroll_factor = y_scroll;
}
Since: gtk+ 3.2
location to store the scroll direction
function Get_Seat (Event : Gdk_Event) return Glib.Object.GObject
Returns the Gdk.Seat.Gdk_Seat this event was generated for. Since: gtk+ 3.20
function Get_Show_Events return Boolean
Gets whether event debugging output is enabled.
True if event debugging output is enabled.
function Get_State (Event : Gdk_Event) return Gdk.Types.Gdk_Modifier_Type
State of the mouse buttons and keyboard keys just prior to the event
function Get_Time (Event : Gdk_Event) return Guint32
Returns the time stamp from Event, if there is one; otherwise returns GDK_CURRENT_TIME. If Event is null, returns GDK_CURRENT_TIME.
time stamp field from Event
function Get_Type return Glib.GType
function Get_Window (Event : Gdk_Event) return Gdk.Gdk_Window
Extracts the Gdk.Gdk_Window associated with an event. Since: gtk+ 3.10
The Gdk.Gdk_Window associated with the event
procedure Handler_Set (Func : Gdk_Event_Func)
Sets the function to call to handle all events from GDK. Note that GTK+ uses this to install its own event handler, so it is usually not useful for GTK+ applications. (Although an application can call this function then call Gtk.Main.Main_Do_Event to pass events to GTK+.)
the function to call to handle events from GDK.
Invalid_Gdouble_Value : constant Gdouble := Gdouble'Last - 1.0;
Invalid_Gint_Value : constant Gint := Gint'Last - 1;
Invalid_Guint32_Value : constant Guint32 := Guint32'Last - 1;
Invalid_Guint_Value : constant Guint := Guint'Last - 1;
Invalid_Gulong_Value : constant Gulong := Gulong'Last - 1;
function Is_Scroll_Stop_Event (Event : Gdk_Event) return Boolean
Check whether a scroll event is a stop scroll event. Scroll sequences with smooth scroll information may provide a stop scroll event once the interaction with the device finishes, e.g. by lifting a finger. This stop scroll event is the signal that a widget may trigger kinetic scrolling based on the current velocity. Stop scroll events always have a a delta of 0/0. Since: gtk+ 3.20
True if the event is a scroll stop event
Key_Press_Mask : constant Gdk_Event_Mask := 1024;
Key_Release_Mask : constant Gdk_Event_Mask := 2048;
Leave_Notify_Mask : constant Gdk_Event_Mask := 8192;
function Peek return Gdk_Event
If there is an event waiting in the event queue of some open display, returns a copy of it. See Gdk.Display.Peek_Event.
a copy of the first Gdk.Event.Gdk_Event on some event queue, or null if no events are in any queues. The returned Gdk.Event.Gdk_Event should be freed with Gdk.Event.Free.
Pointer_Motion_Hint_Mask : constant Gdk_Event_Mask := 8;
Pointer_Motion_Mask : constant Gdk_Event_Mask := 4;
Property_Change_Mask : constant Gdk_Event_Mask := 65536;
type Property_Gdk_Crossing_Mode is new Gdk_Crossing_Mode_Properties.Property;
type Property_Gdk_Event_Mask is new Gdk_Event_Mask_Properties.Property;
type Property_Gdk_Event_Type is new Gdk_Event_Type_Properties.Property;
type Property_Gdk_Notify_Type is new Gdk_Notify_Type_Properties.Property;
type Property_Gdk_Owner_Change is new Gdk_Owner_Change_Properties.Property;
type Property_Gdk_Property_State is new Gdk_Property_State_Properties.Property;
type Property_Gdk_Scroll_Direction is new Gdk_Scroll_Direction_Properties.Property;
type Property_Gdk_Setting_Action is new Gdk_Setting_Action_Properties.Property;
type Property_Gdk_Visibility_State is new Gdk_Visibility_State_Properties.Property;
type Property_Gdk_Window_State is new Gdk_Window_State_Properties.Property;
Proximity_In_Mask : constant Gdk_Event_Mask := 262144;
Proximity_Out_Mask : constant Gdk_Event_Mask := 524288;
procedure Put (Event : Gdk_Event)
Appends a copy of the given event onto the front of the event queue for event->any.window's display, or the default event queue if event->any.window is null. See Gdk.Display.Put_Event.
procedure Request_Motions (Event : Gdk_Event_Motion)
Request more motion notifies if Event is a motion notify hint event. This function should be used instead of Gdk.Window.Get_Pointer to request further motion notifies, because it also works for extension events where motion notifies are provided for devices other than the core pointer. Coordinate extraction, processing and requesting more motion events from a Gdk.Event.Motion_Notify event usually works like this:
{
// motion_event handler
x = motion_event->x;
y = motion_event->y;
// handle (x,y) motion
gdk_event_request_motions (motion_event); // handles is_hint events
}
Since: gtk+ 2.12
a valid Gdk.Event.Gdk_Event
Scroll_Mask : constant Gdk_Event_Mask := 2097152;
procedure Set_Device_Tool
(Event : Gdk_Event;
Tool : access Gdk.Device_Tool.Gdk_Device_Tool_Record'Class)
Sets the device tool for this event, should be rarely used. Since: gtk+ 3.22
tool to set on the event, or null
procedure Set_Show_Events (Show_Events : Boolean)
Sets whether a trace of received events is output. Note that GTK+ must be compiled with debugging (that is, configured using the --enable-debug option) to use this option.
True to output event debugging information.
Smooth_Scroll_Mask : constant Gdk_Event_Mask := 8388608;
Structure_Mask : constant Gdk_Event_Mask := 32768;
Substructure_Mask : constant Gdk_Event_Mask := 1048576;
Tablet_Pad_Mask : constant Gdk_Event_Mask := 33554432;
function To_Address (C : Gdk_Event) return System.Address
Convert an event to the underlying C handler.
function To_Event (Event : access Gdk_Event_Button) return Gdk_Event
Cast Event into a Gdk_Event, which can be used to call some of subprograms in the API. The return value is a pointer to Event, which should therefore remain valid as long as the pointer is in use.
function To_Event (Event : access Gdk_Event_Key) return Gdk_Event
Cast Event into a Gdk_Event, which can be used to call some of subprograms in the API. The return value is a pointer to Event, which should therefore remain valid as long as the pointer is in use.
Touch_Mask : constant Gdk_Event_Mask := 4194304;
Touchpad_Gesture_Mask : constant Gdk_Event_Mask := 16777216;
function Triggers_Context_Menu (Event : Gdk_Event) return Boolean
This function returns whether a Gdk.Event.Gdk_Event_Button should trigger a context menu, according to platform conventions. The right mouse button always triggers context menus. Additionally, if gdk_keymap_get_modifier_mask returns a non-0 mask for GDK_MODIFIER_INTENT_CONTEXT_MENU, then the left mouse button will also trigger a context menu if this modifier is pressed. This function should always be used instead of simply checking for event->button == GDK_BUTTON_SECONDARY. Since: gtk+ 3.4
True if the event should trigger a context menu.
Triple_Button_Press : constant Gdk_Event_Type := Gdk_3button_Press;
Visibility_Notify_Mask : constant Gdk_Event_Mask := 131072;
Window_State_Above : constant Gdk_Window_State := 32;
Window_State_Below : constant Gdk_Window_State := 64;
Window_State_Bottom_Resizable : constant Gdk_Window_State := 16384;
Window_State_Bottom_Tiled : constant Gdk_Window_State := 8192;
Window_State_Focused : constant Gdk_Window_State := 128;
Window_State_Fullscreen : constant Gdk_Window_State := 16;
Window_State_Iconified : constant Gdk_Window_State := 2;
Window_State_Left_Resizable : constant Gdk_Window_State := 65536;
Window_State_Left_Tiled : constant Gdk_Window_State := 32768;
Window_State_Maximized : constant Gdk_Window_State := 4;
Window_State_Right_Resizable : constant Gdk_Window_State := 4096;
Window_State_Right_Tiled : constant Gdk_Window_State := 2048;
Window_State_Sticky : constant Gdk_Window_State := 8;
Window_State_Tiled : constant Gdk_Window_State := 256;
Window_State_Top_Resizable : constant Gdk_Window_State := 1024;
Window_State_Top_Tiled : constant Gdk_Window_State := 512;
Window_State_Withdrawn : constant Gdk_Window_State := 1;