Struct
GdkEventButton
Description [src]
struct GdkEventButton {
GdkEventType type;
GdkWindow* window;
gint8 send_event;
guint32 time;
gdouble x;
gdouble y;
gdouble* axes;
GdkModifierType* state;
guint button;
GdkDevice* device;
gdouble x_root;
gdouble y_root;
}
Used for button press and button release events. The
type field will be one of GDK_BUTTON_PRESS,
GDK_2BUTTON_PRESS, GDK_3BUTTON_PRESS or GDK_BUTTON_RELEASE,
Double and triple-clicks result in a sequence of events being received. For double-clicks the order of events will be:
GDK_BUTTON_PRESSGDK_BUTTON_RELEASEGDK_BUTTON_PRESSGDK_2BUTTON_PRESSGDK_BUTTON_RELEASE
Note that the first click is received just like a normal
button press, while the second click results in a GDK_2BUTTON_PRESS
being received just after the GDK_BUTTON_PRESS.
Triple-clicks are very similar to double-clicks, except that
GDK_3BUTTON_PRESS is inserted after the third click. The order of the
events is:
GDK_BUTTON_PRESSGDK_BUTTON_RELEASEGDK_BUTTON_PRESSGDK_2BUTTON_PRESSGDK_BUTTON_RELEASEGDK_BUTTON_PRESSGDK_3BUTTON_PRESSGDK_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.
Structure members
type:GdkEventTypeThe type of the event (
GDK_BUTTON_PRESS,GDK_2BUTTON_PRESS,GDK_3BUTTON_PRESSorGDK_BUTTON_RELEASE).window:GdkWindowThe window which received the event.
send_event:gint8TRUEif the event was sent explicitly.time:guint32The time of the event in milliseconds.
x:gdoubleThe x coordinate of the pointer relative to the window.
y:gdoubleThe y coordinate of the pointer relative to the window.
axes:gdouble*x,ytranslated to the axes ofdevice, orNULLifdeviceis the mouse.state:GdkModifierTypeA bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See
GdkModifierType.button:guintThe button which was pressed or released, numbered from 1 to 5. Normally button 1 is the left mouse button, 2 is the middle button, and 3 is the right button. On 2-button mice, the middle button can often be simulated by pressing both mouse buttons together.
device:GdkDeviceThe master device that the event originated from. Use
gdk_event_get_source_device()to get the slave device.x_root:gdoubleThe x coordinate of the pointer relative to the root of the screen.
y_root:gdoubleThe y coordinate of the pointer relative to the root of the screen.