[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    Event(3X) manual page Table of Contents

Name

Event - representation of input events

Synopsis

#include <ivplus/event.h>

Description

Event describes the state of input devices at the time an input event occurred. Each event is placed into a global queue which is available to all interactors and the world through calls to Read(). Keyboard events are subject to modification by the virtual key binding mechanism prior to being seen by an application (see VirtualBindings(3X) for a description of Motif virtual key bindings). If an incoming key event corresponds to a Motif virtual binding, the keysym and keystring will be replaced with their corresponding Motif equivalent. This mechanism will reset any modifiers which were used to match the Motif binding.

There are a number of input event types which may occur. See "PUBLIC DATA" below for a complete list of the event types.

Class Hierarchy

Event

Constructors

Event()

Creates an event with no useful information.

Event(Event&)

Creates a copy of the indicated event.

Public Data

enum {


MotionEvent,                  // mouse movedDownEvent,        // button pressedUpEvent,        //
button releasedKeyEvent,        // key pressed, interpreted as asciiEnterEvent,        //
mouse enters canvasLeaveEvent,        // mouse leaves canvasFocusInEvent,        // gain
keyboard focusFocusOutEvent,        // lose keyboard focusDeleteWindowEvent,     //
ICCCM window manager WM_DELETE_WINDOWCheckpointEvent,       // ICCCM window
manager WM_SAVE_YOURSELFNoEvent                    // ignore this event};

These represent every kind of event that may be encountered in InterViews Plus. TimerEvent and ChannelEvent functionality has been moved to Dispatcher. See Dispatcher(3X) for a description.

static const int LEFTMOUSE = 0;

static const int MIDDLEMOUSE = 1;

static const int RIGHTMOUSE = 2;

These represent which of the left, middle, or right mouse buttons were pressed. The same information is available through leftmouse, middlemouse, and rightmouse below.

Interactor* target;

Points to the lowest-level interactor which indicated interest in this type of event. See Sensor(3X) for an explanation for expressing event interest.

unsigned long timestamp;

Represents the number of milliseconds since the X server was reset.

EventType eventType;

Represents which type of event this is.

IntCoord x, y;

Location of mouse relative to target. A location of <0, 0> indicates the mouse is at the lower left corner of the target.

boolean control;

boolean meta;

boolean shift;

boolean shiftlock;

boolean leftmouse;

boolean middlemouse;

boolean rightmouse;

These will be true if the corresponding key or button was down at the time this event occurred.

unsigned char button;

The number of the button pressed or released, if any. Returns one of LEFTMOUSE, MIDDLEMOUSE, or RIGHTMOUSE based on which mouse button was pressed or released.

unsigned short len;

The length of the ASCII string representing the key.

char* keystring;

ASCII interpretation of the event, if any.

unsigned long keysym;

X keysym value for this key.

Public Operations

void GetAbsolute(IntCoord&, IntCoord&);

void GetAbsolute(World*&, IntCoord&, IntCoord&);

Return the world coordinates associated with this event. The second version also returns a pointer to the world in which this event occurred.

char* GetKeysymString();

Returns the string associated with the keysym.

EventRep* Rep() const;

Returns a pointer to the EventRep for the event. The EventRep class is a low level interface to X Windows. It is not expected that developers will need details of the EventRep interface so the EventRep class is not documented.

Protected Operations

None.

X Resources

None.

Examples

None.

Files


event.h

See Also

Interactor(3X) , Sensor(3X) , VirtualBindings(3X) , World(3X) .


Table of Contents