Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Gdk::EventButton Class Reference

A GdkEventButton C++ wrapper class. More...

`#include <events.h>`

Inheritance diagram for Inti::Gdk::EventButton:

List of all members.

## Public Member Functions

Accessors

- GdkEventButton * gdk_event_button () const
    Get a pointer to the GdkEventButton structure.
- unsigned int time () const
    Returns the time of the event in milliseconds.
- double x () const
    Returns the X coordinate of the pointer relative to the window.
- double y () const
    Returns the Y coordinate of the pointer relative to the window.
- double * axes () const
    Returns x, y translated to the axes of the device, or null if device is the mouse.
- ModifierTypeField state () const
    Returns a bit-mask representing the state of the modifier keys (for example, Control, Shift and Alt) and the pointer buttons (see Gdk::ModifierType).
- unsigned int button () const
    Returns the button which was pressed or released, numbered from 1 to 5.
- Device * device () const
    Returns the Device where the event originated.
- double x_root () const
    Returns the X coordinate of the pointer relative to the root of the screen.
- double y_root () const
    Returns the Y coordinate of the pointer relative to the root of the screen.

## Detailed Description

A GdkEventButton C++ wrapper class.

An EventButton is used for button press and button release events.

The event type will be one of BUTTON_PRESS, TWO_BUTTON_PRESS, THREE_BUTTON_PRESS and BUTTON_RELEASE. Double and triple-clicks result in a sequence of events being received.

For double-clicks the order of events will be:

- BUTTON_PRESS
- BUTTON_RELEASE
- BUTTON_PRESS
- TWO_BUTTON_PRESS
- BUTTON_RELEASE

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

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

- BUTTON_PRESS
- BUTTON_RELEASE
- BUTTON_PRESS
- TWO_BUTTON_PRESS
- BUTTON_RELEASE
- BUTTON_PRESS
- THREE_BUTTON_PRESS
- 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.

## Member Function Documentation

unsigned int Inti::Gdk::EventButton::button | ( |  | ) | const

| 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-button mice, the middle button can often be simulated by pressing both mouse buttons together. Reimplemented from Inti::Gdk::Event.

The documentation for this class was generated from the following file:

- events.h

Main Page - Footer