gdk.event_button

Module for [EventButton] class

Types 1

Used for button press and button release events. The @type field will be one of [gdk.types.EventType.ButtonPress], [gdk.types.EventType._2buttonPress], [gdk.types.EventType._3buttonPress] or [gdk.types.EventType.ButtonRelease],

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

  • [gdk.types.EventType.ButtonPress]
  • [gdk.types.EventType.ButtonRelease]
  • [gdk.types.EventType.ButtonPress]
  • [gdk.types.EventType._2buttonPress]
  • [gdk.types.EventType.ButtonRelease]

Note that the first click is received just like a normal button press, while the second click results in a [gdk.types.EventType._2buttonPress] being received just after the [gdk.types.EventType.ButtonPress].

Triple-clicks are very similar to double-clicks, except that [gdk.types.EventType._3buttonPress] is inserted after the third click. The order of the events is:

  • [gdk.types.EventType.ButtonPress]
  • [gdk.types.EventType.ButtonRelease]
  • [gdk.types.EventType.ButtonPress]
  • [gdk.types.EventType._2buttonPress]
  • [gdk.types.EventType.ButtonRelease]
  • [gdk.types.EventType.ButtonPress]
  • [gdk.types.EventType._3buttonPress]
  • [gdk.types.EventType.ButtonRelease]

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.

Fields
GdkEventButton _cInstance
Methods
void * _cPtr()
gdk.types.EventType type() @propertyGet `type` field. Returns: the type of the event ([gdk.types.EventType.ButtonPress], [gdk.types.EventType.2buttonPress], [gdk.types.EventType.3buttonPress] or [gdk.types.EventType.ButtonRelease]).
void type(gdk.types.EventType propval) @propertySet `type` field. Params: propval = the type of the event ([gdk.types.EventType.ButtonPress], [gdk.types.EventType.2buttonPress], [gdk.types.EventType.3buttonPress] or [gdk.types.EventType.ButtonRe...
gdk.window.Window window() @propertyGet `window` field. Returns: the window which received the event.
void window(gdk.window.Window propval) @propertySet `window` field. Params: propval = the window which received the event.
byte sendEvent() @propertyGet `sendEvent` field. Returns: true if the event was sent explicitly.
void sendEvent(byte propval) @propertySet `sendEvent` field. Params: propval = true if the event was sent explicitly.
uint time() @propertyGet `time` field. Returns: the time of the event in milliseconds.
void time(uint propval) @propertySet `time` field. Params: propval = the time of the event in milliseconds.
double x() @propertyGet `x` field. Returns: the x coordinate of the pointer relative to the window.
void x(double propval) @propertySet `x` field. Params: propval = the x coordinate of the pointer relative to the window.
double y() @propertyGet `y` field. Returns: the y coordinate of the pointer relative to the window.
void y(double propval) @propertySet `y` field. Params: propval = the y coordinate of the pointer relative to the window.
gdk.types.ModifierType state() @propertyGet `state` field. Returns: a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See #GdkModifierType.
void state(gdk.types.ModifierType propval) @propertySet `state` field. Params: propval = a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See #GdkModifierType.
uint button() @propertyGet `button` field. Returns: 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-butt...
void button(uint propval) @propertySet `button` field. Params: propval = 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. ...
gdk.device.Device device() @propertyGet `device` field. Returns: the master device that the event originated from. Use [gdk.event.Event.getSourceDevice] to get the slave device.
void device(gdk.device.Device propval) @propertySet `device` field. Params: propval = the master device that the event originated from. Use [gdk.event.Event.getSourceDevice] to get the slave device.
double xRoot() @propertyGet `xRoot` field. Returns: the x coordinate of the pointer relative to the root of the screen.
void xRoot(double propval) @propertySet `xRoot` field. Params: propval = the x coordinate of the pointer relative to the root of the screen.
double yRoot() @propertyGet `yRoot` field. Returns: the y coordinate of the pointer relative to the root of the screen.
void yRoot(double propval) @propertySet `yRoot` field. Params: propval = the y coordinate of the pointer relative to the root of the screen.
Constructors
this(void * ptr, Flag!"Take" take)