Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Event Class Reference

User interface Event from mouse or keyboard. More...

#include <Event.h>

List of all members.

Public Types

enum  MouseButton { LeftButton, MiddleButton, RightButton }
 The mouse button that was pressed/released. More...

enum  ButtonMask {
  LeftMask = 1, RightMask = 2, ShiftMask = 4, CtrlMask = 8,
  MiddleMask = 16
}
 Bitmasks for the currently pressed mouse buttons. More...

enum  Type {
  Unkown, Key, KeyDown, KeyUp,
  MouseMove, MouseWheel, MouseClick, MouseRelease
}
 The type of event. More...


Public Methods

 Event (Type tt=Unkown)
 Default contructor.

bool isKeyEvent ()
 Returns true iff the event is a keyboard event.

bool isMouseEvent ()
 Returns true iff the event is a mouse event.

Event & operator= (Type tt)
 Assigns the type value tt.

bool operator== (Type tt)
 Returns true iff event is of type tt.

bool operator!= (Type tt)
 Returns true iff event is *not* of type tt.

Type type ()
 Returns the event type.


Public Attributes

Type t
 The type of input event.

MouseButton button
 The mouse button that was pressed/released. More...

short state
 The state of the buttons, not including the one currently pressed/released. More...

short key
 The key that was pressed/released. More...

short x
 The mouse coordinates where the event occured.

short y
 The mouse coordinates where the event occured.

short dx
 Amount of mouse movement since the last event. More...

short dy
 Amount of mouse movement since the last event. More...


Detailed Description

User interface Event from mouse or keyboard.

Todo:
Hide public attributes.


Member Enumeration Documentation

enum Event::ButtonMask
 

Bitmasks for the currently pressed mouse buttons.

Enumeration values:
LeftMask  The left mouse button is held down.
RightMask  The right mouse button is held down.
ShiftMask  The shift button is held down.
CtrlMask  The control button is held down.
MiddleMask  The middle mouse button is held down.

enum Event::MouseButton
 

The mouse button that was pressed/released.

Enumeration values:
LeftButton  Left mouse button is pressed.
MiddleButton  Middle mouse button is pressed.
RightButton  Right mouse button is pressed.

enum Event::Type
 

The type of event.

Enumeration values:
Unkown  The event is unkown or un-initialized.
Key  A character is pressed or is repeated.
KeyDown  A (virtual) key is pressed
See also:
keydef.win32.h.
KeyUp  A (virtual) key is released.
MouseMove  The mouse pointer has been moved.
MouseWheel  The mouse wheel is turned (win32 only).
MouseClick  A mouse button is pressed.
MouseRelease  A mouse button is released.


Member Data Documentation

MouseButton Event::button
 

The mouse button that was pressed/released.

Only valid when type() is one of:

  • MouseMove
  • MouseWheel
  • MouseClick
  • MouseRelease

short Event::dx
 

Amount of mouse movement since the last event.

Only valid when type() is MouseMove.

short Event::dy
 

Amount of mouse movement since the last event.

Only valid when type() is MouseMove.

short Event::key
 

The key that was pressed/released.

Only valid when type() is one of:

  • Key
  • KeyDown
  • KeyUp

short Event::state
 

The state of the buttons, not including the one currently pressed/released.

Only valid when type() is one of:

  • MouseMove
  • MouseWheel
  • MouseClick
  • MouseRelease
See also:
ButtonMask


The documentation for this class was generated from the following file:
This documentation was generated using doxygen. If you have any comments or additions please mail me.