Gjsify LogoGjsify Logo

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_PRESS
  • %GDK_BUTTON_RELEASE
  • %GDK_BUTTON_PRESS
  • %GDK_2BUTTON_PRESS
  • %GDK_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_PRESS
  • %GDK_BUTTON_RELEASE
  • %GDK_BUTTON_PRESS
  • %GDK_2BUTTON_PRESS
  • %GDK_BUTTON_RELEASE
  • %GDK_BUTTON_PRESS
  • %GDK_3BUTTON_PRESS
  • %GDK_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.

record

Hierarchy

  • EventButton

Index

Constructors

Properties

axes: number

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

field
button: number

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.

field
device: Gdk.Device

the master device that the event originated from. Use gdk_event_get_source_device() to get the slave device.

field
send_event: number

%TRUE if the event was sent explicitly.

field

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

field
time: number

the time of the event in milliseconds.

field

the type of the event (%GDK_BUTTON_PRESS, %GDK_2BUTTON_PRESS, %GDK_3BUTTON_PRESS or %GDK_BUTTON_RELEASE).

field
window: Gdk.Window

the window which received the event.

field
x: number

the x coordinate of the pointer relative to the window.

field
x_root: number

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

field
y: number

the y coordinate of the pointer relative to the window.

field
y_root: number

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

field
name: string

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method