Gdk.EventButton

Fields

Name

Type

Access

Description

axes

float

r/w

x, y translated to the axes of device, or None if device is the mouse.

button

int

r/w

the 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

Gdk.Device

r/w

the master device that the event originated from. Use Gdk.Event.get_source_device() to get the slave device.

send_event

int

r/w

True if the event was sent explicitly.

state

Gdk.ModifierType

r/w

a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See Gdk.ModifierType.

time

int

r/w

the time of the event in milliseconds.

type

Gdk.EventType

r/w

the type of the event (Gdk.EventType.BUTTON_PRESS, Gdk.EventType._2BUTTON_PRESS, Gdk.EventType._3BUTTON_PRESS or Gdk.EventType.BUTTON_RELEASE).

window

Gdk.Window

r/w

the window which received the event.

x

float

r/w

the x coordinate of the pointer relative to the window.

x_root

float

r/w

the x coordinate of the pointer relative to the root of the screen.

y

float

r/w

the y coordinate of the pointer relative to the window.

y_root

float

r/w

the y coordinate of the pointer relative to the root of the screen.

Methods

None

Details

class Gdk.EventButton

Used for button press and button release events. The type field will be one of Gdk.EventType.BUTTON_PRESS, Gdk.EventType._2BUTTON_PRESS, Gdk.EventType._3BUTTON_PRESS or Gdk.EventType.BUTTON_RELEASE,

Double and triple-clicks result in a sequence of events being received. For double-clicks the order of events will be:

Note that the first click is received just like a normal button press, while the second click results in a Gdk.EventType._2BUTTON_PRESS being received just after the Gdk.EventType.BUTTON_PRESS.

Triple-clicks are very similar to double-clicks, except that Gdk.EventType._3BUTTON_PRESS is inserted after the third click. The order of the events is:

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.